Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to update datetime field automatically
Message
From
16/07/2007 08:06:44
 
 
To
15/07/2007 22:27:58
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2000
Miscellaneous
Thread ID:
01240587
Message ID:
01240625
Views:
9
>I have a database which has many table with 'updatedon' field of datetime type. These are updated on the client side. I want then to be updated on the server through triggers. And possibly with only one procedure called by all the table.
>
>1> How can I dynamically find out the table contains updatedon field and its type.
>2> Is there any globally called trigger called by every table in the database which will update the field.
>
>
>Rajesh



I use the simpler method of adding default code to the column: GetDate() and mark them as "not null".
Therefore if the date value is not supplied in Update and Insert statements, the table automatically will insert the proper DateTime.


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform