我在表上创建了一个触发器,现在我无法更改或删除它。我什至无法访问该表。我能做些什么?
触发脚本:
create trigger [Products].[InsertLessThen5InStock]
on [Products].[Products]
after update
as
BEGIN
DECLARE @ck int
select UnitsInStock from Products.Products where UnitsInStock<5
set @ck=@@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