我在表上創建了一個觸發器,現在我無法更改或刪除它。 我甚至不能訪問表。 我該怎麼辦?無法刪除觸發器
觸發腳本:
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