摘要:
CREATE TRIGGER tg_nameON TableNameFOR INSERT,UPDATE,DELETE /*一种或多种*/ASdeclare... ;select ... from deleted; /*取得更新之前数据*/select... from inserted;/*取得更新之后数据*/if update(field name) /*针对具体列*/ begin ..... end 阅读全文
摘要:
ALTER function [dbo].[GetOwnerString](@Id int)returns nvarchar(200)asbegindeclare @result nvarchar(200),@owner nvarchar(20);set @result='';declare owner_cursor cursor for select Owner from InProcess where ProjectId=@Id;open owner_cursor;fetch next from owner_cursor into @owner;while(@@FETCH_ 阅读全文