|
-
December 27th, 1999, 02:19 AM
#1
update trigger
update trigger written as follows is not working and we are not able to update the record because of the foreign key constraints violation.pls help and
do send the reply at [email protected]
Create Trigger <trigname> on <tablename>
for update
as
declare @key_after nvarchar,@key_before nvarchar
if UPDATE( <fieldname> )
begin
Select @key_before = <fieldname> from deleted
Select @key_after = <fieldname> from inserted
Update <fk_table_name>
set <fieldname> = @key_after
where <fieldname> = @key_before
end
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|