Ms Sql 2000

Please support our MS SQL advertiser: Intel Parallel Studio Home
Reply

Join Date: Mar 2004
Posts: 634
Reputation: Slade has a spectacular aura about Slade has a spectacular aura about 
Solved Threads: 7
Slade's Avatar
Slade Slade is offline Offline
Practically a Master Poster

Ms Sql 2000

 
0
  #1
Jun 11th, 2004
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
Formerly known as Slade.
Reply With Quote Quick reply to this message  
Join Date: May 2004
Posts: 92
Reputation: gusano79 is on a distinguished road 
Solved Threads: 8
gusano79 gusano79 is offline Offline
Junior Poster in Training

Re: Ms Sql 2000

 
1
  #2
Jun 15th, 2004
Originally Posted by slade
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 <trigger_name>
ON <table_name>
FOR INSERT, UPDATE
AS
<trigger_body>

Here's the T-SQL reference page:
http://msdn.microsoft.com/library/de...eate2_7eeq.asp
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 634
Reputation: Slade has a spectacular aura about Slade has a spectacular aura about 
Solved Threads: 7
Slade's Avatar
Slade Slade is offline Offline
Practically a Master Poster

Re: Ms Sql 2000

 
0
  #3
Jun 15th, 2004
Thankyou very much, your help will not go unrewarded.
Formerly known as Slade.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC