954,593 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Ms Sql 2000

I need to create a date updated field for ms sql 2000. The current trigger I have only works for the insertion of data and it is "(getdate())" is there one that I can use for insertion and update of fields?

Ta,

Slade

Slade
Practically a Master Poster
633 posts since Mar 2004
Reputation Points: 115
Solved Threads: 7
 
I need to create a date updated field for ms sql 2000. The current trigger I have only works for the insertion of data and it is "(getdate())" is there one that I can use for insertion and update of fields?

You can write a trigger that fires on both insert and update:

CREATE TRIGGER
ON
FOR INSERT, UPDATE
AS

Here's the T-SQL reference page: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_create2_7eeq.asp

gusano79
Posting Pro
521 posts since May 2004
Reputation Points: 182
Solved Threads: 77
 

Thankyou very much, your help will not go unrewarded.

Slade
Practically a Master Poster
633 posts since Mar 2004
Reputation Points: 115
Solved Threads: 7
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You