Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trigger is locking up record
Message
From
29/04/2004 08:10:31
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00899034
Message ID:
00899263
Views:
17
CREATE TRIGGER [TESTING] ON dbo.Table1
FOR INSERT, UPDATE
AS

DECLARE @testingTable1ID int
DECLARE @Data1 char(10)

SET @testingTable1ID = (SELECT testingTable1ID from inserted)

SET @Data1 = (SELECT TT1Data1 From Table1 where testingTable1ID = @testingTable1ID)

insert into Table2 (TT2Data1) values (@Data1)

--=============================
CREATE TRIGGER [TESTING2] ON dbo.Table2
FOR INSERT, UPDATE
AS

DECLARE @testingTable2ID int
DECLARE @Data2 char(10)

SET @testingTable2ID = (SELECT testingTable2ID from inserted)

update Table2
set TT2Data2 = 'whatever'
where testingTable2ID = @testingTable2ID
Thank You

Rollin Burr

Politicians and diapers have one thing in common. They should both be changed regularly, and for the same reason.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform