January 22, 2010 at 3:28 am
Hi all,
My table does not have a created date or modified date column.
My query is to get the created date of all the records in a particular table .Is it possible.
I have tried various ways and found its not possible,still wanted to get it confirmed.
If there s any ways kindly help me.
Thank you all in advance.
January 22, 2010 at 3:46 am
dp-01 (1/22/2010)
My table does not have a created date or modified date column.My query is to get the created date of all the records in a particular table .Is it possible.
No.
If you need to know created date of rows, you need a column of type datetime that has a default of getdate(). If you do not have that, there is no way that you can tell when the rows were created.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
January 22, 2010 at 3:59 am
yes.
Thank you for your quick reply on that Shaw.
Good Day .
January 22, 2010 at 4:02 am
Try
CREATE TABLE MYTABLE (Name Varchar(60),IPDate DATETIME DEFAULT GETDATE())
INSERT INTO MYTABLE (Name) VALUES('MYName' )
Select * from MYTABLE
you will be getting the date and time when a new record is inserted to ur table
Thanks
Parthi
January 22, 2010 at 4:13 am
Parthi , I hope you have misunderstood my query.
I have already my schema and it is "Live".
No space to create a new table with the column.
Anyways thanks for your reply.
Good day.
January 22, 2010 at 4:24 am
I have already my schema and it is "Live".
No space to create a new table with the column.
What is mean by No space to create a new table with the column.? what are you trying to say
ALTER TABLE MYTABLE ADD date DATETIME
go
ALTER TABLE dbo.MyTABLE ADD CONSTRAINT
DF_MyTABLE_date DEFAULT GETDATE() FOR date
Thanks
Parthi
January 22, 2010 at 4:41 am
parthi-1705 (1/22/2010)
What is mean by No space to create a new table with the column.? what are you trying to sayALTER TABLE MYTABLE ADD date DATETIME
go
ALTER TABLE dbo.MyTABLE ADD CONSTRAINT
DF_MyTABLE_date DEFAULT GETDATE() FOR date
Which will help future rows, but is not going to tell when rows that are already in the table were created. That, as far as I can tell, is what Prasanna wants, to find out when rows that are already in the table were created.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
January 22, 2010 at 4:42 am
hmmm ... I have already lacks and lacks of data in my table which is already inserted.
you are trying to give a solution for future but presently I need to get the records Inserted date in that table. Got it Parthi.
January 22, 2010 at 5:07 am
presently I need to get the records Inserted date in that table.
Then use 3rd party Tool log Rescue (if you u have from beginning) and find date and time row by row record inserted in your table you will be getting.If you or not having Log then just leave it no other way is there to update the previous data's
If You need older datas date and time then do it one by one as it in Log file.
Thanks
Parthi
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply