我在表上创建了一个触发器,现在我无法更改或删除它。 我甚至不能访问表。 我该怎么办?无法删除触发器
触发脚本:
create trigger [Products].[InsertLessThen5InStock]
on [Products].[Products]
after update
as
BEGIN
DECLARE @ck int
select UnitsInStock from Products.Products where UnitsInStock<5
set @[email protected]@ROWCOUNT
print @ck
if @ck >0
BEGIN
DECLARE @mails varchar (200)
exec dbo.Manager_email @mails output
EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'DefaultMailSender',
@recipients = @mails ,
@body = 'Products that will expire in less then 5 days',
@subject = 'Products that will expire in less then 5 days',
@body_format = 'HTML',
@query = 'EXECUTE MadCat.dbo.SaveTableAsHTML
@DBFetch =''select UnitsInStock from Products.Products where UnitsInStock<5'''
END
END
GO
为什么你不能改变它或删除它? – PowerUser 2013-03-27 18:42:02
你运行哪些脚本来尝试删除或修改它?你得到什么错误? “我甚至不能访问表格”是什么意思?你需要更多地了解你的问题,以及你所尝试过的。 – LittleBobbyTables 2013-03-27 18:42:39
我试图删除它抛出gui并放下触发器... – DnL 2013-03-27 18:43:18