TRIGGER

ALTER TRIGGER [dbo].[trigCateDelete]
   ON  [dbo].[category]
   instead of DELETE
AS
BEGIN
    declare @caId int
    select @caId=(select id from deleted)
    delete comment where newsId in (select newsId from news where caId=@caId)
    delete news where caId=@caId
    delete category where id=@caId

END

ALTER procedure [dbo].[pc_login]
    @name varchar(30),
    @pwd varchar(30)
as
select count(*) from tb_user where userName=@name and password=@pwd
原文地址:https://www.cnblogs.com/hishanghai/p/2533368.html