does sql server main log for inserted records

Posted by Bhupentiwari under Sql Server on 9/18/2012 | Points: 10 | Views : 920 | Status : [Member] | Replies : 2
Hi,

How to find record inserted time in sql server? There is no any date field in the table.

Please give me solution.

Bye

Thanks n Regards
Bhupendra Tiwari



Responses

Posted by: Vikash on: 9/18/2012 [Member] Starter | Points: 25

Up
0
Down
In MS SQL timestamp isnt anything to do with the date or time but to do with the order in which modifications took place
As far as I am aware there isnt really a log if you have forgotten to add the relevant column
You would need to have either a datetime or smalltimedate column with a default value of getdate()

You should probably just use a datetime or smalldatetime column for timestamps. SQL Servers timestamp type does not store datetime information at all but just a uniqueidentifier that changes when a row is created or updated. You can only have 1 timestamp column per table.

Like flippers.be said, use getdate() as the column default. I like to user getutcdate() personally as a default

Regards,
Vikash Pathak

Bhupentiwari, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bhupentiwari on: 9/18/2012 [Member] Starter | Points: 25

Up
0
Down
whatever your are telling gentle man that i know. but please read my question

Thanks n Regards
Bhupendra Tiwari

Bhupentiwari, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response