I need a timestamp to be created automatically when I insert information in a table. mySQL has TimeStamp but MS SQL Server TimeStamp doesn’t correspond mySQL. Is there any other way around?
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
From MSDN: "The Transact-SQL timestamp data type is not the same as the timestamp data type defined in the SQL-92 standard. The SQL-92 timestamp data type is equivalent to the Transact-SQL datetime data type."
To be able to have a date automatically inserted in your table, you should have a column of type datetime with a default value of getdate() - the system function that shows the current date of the system.