代码
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
-- =============================================
--
 Author:        <Author,,Name>
--
 Create date: <Create Date,,>
--
 Description:    <Description,,>
--
 =============================================
ALTER TRIGGER [dbo].[DenyDelete]
   
ON  [dbo].[tbsmstemplate]
   
for delete
AS 
BEGIN
    
-- SET NOCOUNT ON added to prevent extra result sets from
    -- interfering with SELECT statements.
    SET NOCOUNT ON;

    
-- Insert statements for trigger here
    if exists (select 1 from deleted where fsmstemplateid in (22,23,24,25))   
    
begin   
        
RAISERROR ('不能删除id=0的记录'161)   
        
ROLLBACK TRANSACTION   
    
end   
END

 

相关文章:

  • 2022-12-23
  • 2021-09-26
  • 2022-02-19
  • 2022-12-23
  • 2022-12-23
  • 2022-02-07
  • 2022-02-22
猜你喜欢
  • 2021-07-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-02
  • 2022-01-11
  • 2021-11-11
相关资源
相似解决方案