Hi alle!
Ich arbeite mit dem MSSQL-Server 2005.
Um eine Tabelle anzulegen, nutze ich folgendes Statement:
CREATE TABLE tabellen_name (
id int IDENTITY(1,1) PRIMARY KEY NOT NULL,
-- ...
lastchange smalldatetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
-- ...
)
Wie kann ich jetzt fordern, dass bei jedem Update, die Spalte lastchange wiederrum auf den aktuellen Zeitpunkt geändert wird?
Ich weiß, dass ich einen Trigger definieren kann und Constraints nicht weiterhelfen, möchte aber wissen, ob es eine komfortablere Möglichkeit gibt (ala lastchange smalldatetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE SET DEFAULT).
Danke für eure Hilfe,
H☼psel
--
"It's amazing I won. I was running against peace, prosperity, and incumbency."
George W. Bush speaking to Swedish Prime Minister unaware a live television camera was still rolling, June 14, 2001
Selfcode: ie:% fl:( br:> va:) ls:& fo:) rl:? n4:& ss:| de:] js:| ch:? sh:( mo:) zu:)
"It's amazing I won. I was running against peace, prosperity, and incumbency."
George W. Bush speaking to Swedish Prime Minister unaware a live television camera was still rolling, June 14, 2001
Selfcode: ie:% fl:( br:> va:) ls:& fo:) rl:? n4:& ss:| de:] js:| ch:? sh:( mo:) zu:)