how is it possible to set a filed in a database to automatically add the current time to the filed at run time, is this possible; this filed has already been identified as 'DateTime' .
i am using VS2005 and VB language.
Do you mean when you insert a record into a table, that it automatically adds the current date time to one of its date time column? Like a time stamp? Please correct me if i am wrong?
You can do this in your stored procedure rather than in your application code.
Assuming you are using SQL Server you can set your date time column to equal = GETDATE()
||| You can set a default value for that date column to GetDate (SQL) or sysdate (Oracle)
where can i find the GetDate (SQL) in VS 2005?
|||
faezeh:
where can i find the GetDate (SQL) in VS 2005?
GETDATE() is a function
so for example for an INSERT you will do this
INSERT INTO myTable(columnOne, dateTimeColumn)VALUES ('Hello World',GETDATE())
No comments:
Post a Comment