Thursday, March 22, 2012
database file has incorrect modified date
I have a very critical data file currently in use showing a modified date of
5/13/06, and the file is modified very often by an invoice application. When
I attempt to do a restore the file has the right date, I don't understand wh
y
the modified date is incorrect.
Should the file modified date not be very current, although if query for
invoices with date greater than 6/2 it return several. am I missreading the
modified date?
Please help.ITDUDE27 wrote on Mon, 5 Jun 2006 09:05:01 -0700:
> Hello all,
> I have a very critical data file currently in use showing a modified date
> of 5/13/06, and the file is modified very often by an invoice application.
> When I attempt to do a restore the file has the right date, I don't
> understand why the modified date is incorrect.
> Should the file modified date not be very current, although if query for
> invoices with date greater than 6/2 it return several. am I missreading
> the modified date?
> Please help.
You can't go by the last modified date of the mdf/ldf files on the hard
disk, as these dates are only normally updated when SQL Server feels the
need to. I have a database on my main server right now that processes all
the transactions for the company and has a last modified date of 25th May
2006, and a matching LDF with last modified of 15th September 2005.
Actually, most of the files in there are dated 15th Sept 2005, which is the
day this server had them all restored to it when it went live.
Dan|||"ITDUDE27" <ITDUDE27@.discussions.microsoft.com> wrote in message
news:1A118DF6-E57A-428A-935D-AE676D8BEF83@.microsoft.com...
> Hello all,
> I have a very critical data file currently in use showing a modified date
of
> 5/13/06, and the file is modified very often by an invoice application.
When
> I attempt to do a restore the file has the right date, I don't understand
why
> the modified date is incorrect.
>
The last modified date will only change when the file size is changed or the
database is open or closed.
Unless you have autoclose enabled (you should NOT normally) the only time
the database will normally close is when you stop or start the server.
If your server is up for a year, it's not unheard of to have a last modified
date of a year ago.
> Should the file modified date not be very current, although if query for
> invoices with date greater than 6/2 it return several. am I missreading
the
> modified date?
> Please help.
database file has incorrect modified date
I have a very critical data file currently in use showing a modified date of
5/13/06, and the file is modified very often by an invoice application. When
I attempt to do a restore the file has the right date, I don't understand why
the modified date is incorrect.
Should the file modified date not be very current, although if query for
invoices with date greater than 6/2 it return several. am I missreading the
modified date?
Please help.ITDUDE27 wrote on Mon, 5 Jun 2006 09:05:01 -0700:
> Hello all,
> I have a very critical data file currently in use showing a modified date
> of 5/13/06, and the file is modified very often by an invoice application.
> When I attempt to do a restore the file has the right date, I don't
> understand why the modified date is incorrect.
> Should the file modified date not be very current, although if query for
> invoices with date greater than 6/2 it return several. am I missreading
> the modified date?
> Please help.
You can't go by the last modified date of the mdf/ldf files on the hard
disk, as these dates are only normally updated when SQL Server feels the
need to. I have a database on my main server right now that processes all
the transactions for the company and has a last modified date of 25th May
2006, and a matching LDF with last modified of 15th September 2005.
Actually, most of the files in there are dated 15th Sept 2005, which is the
day this server had them all restored to it when it went live.
Dan|||"ITDUDE27" <ITDUDE27@.discussions.microsoft.com> wrote in message
news:1A118DF6-E57A-428A-935D-AE676D8BEF83@.microsoft.com...
> Hello all,
> I have a very critical data file currently in use showing a modified date
of
> 5/13/06, and the file is modified very often by an invoice application.
When
> I attempt to do a restore the file has the right date, I don't understand
why
> the modified date is incorrect.
>
The last modified date will only change when the file size is changed or the
database is open or closed.
Unless you have autoclose enabled (you should NOT normally) the only time
the database will normally close is when you stop or start the server.
If your server is up for a year, it's not unheard of to have a last modified
date of a year ago.
> Should the file modified date not be very current, although if query for
> invoices with date greater than 6/2 it return several. am I missreading
the
> modified date?
> Please help.
Wednesday, March 7, 2012
Database design question with time
hours and minutes he worked for the day..now i can do this
Workdate small date
Hours integer
Minutes integer
But then would I have to have the front end know that when adding up
the hours and minutes for the week that 60 minutes = 1 hour or is
there some way to do this in the database?
thanks
-JimJim (jim.ferris@.motorola.com) writes:
> Im designing a database where a user enters the date and the number of
> hours and minutes he worked for the day..now i can do this
> Workdate small date
> Hours integer
> Minutes integer
>
> But then would I have to have the front end know that when adding up
> the hours and minutes for the week that 60 minutes = 1 hour or is
> there some way to do this in the database?
You could have a computed column with the forumla Minutes + 60 * Hours:
CREATE TABLE workhours (
userid userid_type NOT NULL,
workdate smalldatetime NOT NULL,
hours tinyint NOT NULL,
minutes tinyint NOT NULL,
worked_minutes AS minutes + 60 * hours,
CONSTRAINT pk_workhours(userid, workdate))
--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||>> ... database where a user enters the date and the number of hours
and minutes he worked for the day..<<
Use a duration instead of trying to create your own temporal datatype
system.
CREATE TABLE Timecard
(emp_id INTEGER NOT NULL,
start_time DATETIME NOT NULL,
finish_time DATETIME, -- null means still active
PRIMARY KEY (emp_id, start_time));
You can now use BETWEEN predicates and a calendar table.|||Thanks Ill try that
-Jim
Erland Sommarskog <sommar@.algonet.se> wrote in message news:<Xns9474F24297CBCYazorman@.127.0.0.1>...
> Jim (jim.ferris@.motorola.com) writes:
> > Im designing a database where a user enters the date and the number of
> > hours and minutes he worked for the day..now i can do this
> > Workdate small date
> > Hours integer
> > Minutes integer
> > But then would I have to have the front end know that when adding up
> > the hours and minutes for the week that 60 minutes = 1 hour or is
> > there some way to do this in the database?
> You could have a computed column with the forumla Minutes + 60 * Hours:
> CREATE TABLE workhours (
> userid userid_type NOT NULL,
> workdate smalldatetime NOT NULL,
> hours tinyint NOT NULL,
> minutes tinyint NOT NULL,
> worked_minutes AS minutes + 60 * hours,
> CONSTRAINT pk_workhours(userid, workdate))
Friday, February 17, 2012
Database created date?
created, using T-SQL?
I know sp_helpdb returns created date, but it's char(11) type and not much
use because of different regional settings.
Thanks in advance,
Martin.Hi Martin,
I think that if you take a look into sysdatabases allocated in Master you'll
obtain that information.
Regards,
--
Current location: Alicante (ES)
"Martin H." wrote:
> I was wondering, is it possible to find out the date when database was
> created, using T-SQL?
> I know sp_helpdb returns created date, but it's char(11) type and not much
> use because of different regional settings.
> Thanks in advance,
> Martin.|||What version of SQL Server? In 2005, you can use below:
SELECT create_date FROM sys.databases
WHERE name = 'pubs'
In 2000, use sysdatabases in master instead.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Martin H." <MartinH@.discussions.microsoft.com> wrote in message
news:8183038A-E73E-4866-A1B9-70723FC573E5@.microsoft.com...
>I was wondering, is it possible to find out the date when database was
> created, using T-SQL?
> I know sp_helpdb returns created date, but it's char(11) type and not much
> use because of different regional settings.
> Thanks in advance,
> Martin.|||hi Tibor,
In sql25k sysdatabases is allocated in user database or in master as it
customary?
--
Current location: Alicante (ES)
"Tibor Karaszi" wrote:
> What version of SQL Server? In 2005, you can use below:
> SELECT create_date FROM sys.databases
> WHERE name = 'pubs'
> In 2000, use sysdatabases in master instead.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Martin H." <MartinH@.discussions.microsoft.com> wrote in message
> news:8183038A-E73E-4866-A1B9-70723FC573E5@.microsoft.com...
>
>|||Eh, my bad, i dont know how i missed so obvious solution.
Thanks for your fast responses,
Martin.