문제

I am doing maintenance on a legacy ASP.NET 3.5 and SQL Server web application. A particular feature is broken. Checking the log file reveals the following error:

Error: SqlException (262): Procedure: spMyStoredProcedure Line: 10 State: 20 Message: DISABLE TRIGGER permission denied in database 'MyDatabase'.

The stored procedure code is:

ALTER Procedure dbo.spMyStoredProcedure
as
    --Disable Triggers, no need to copy records into history tables
    Disable TRIGGER Trigger1 on myschema.table1;
    Disable TRIGGER Trigger2 on myschema.table2;
    Disable TRIGGER Trigger3 on myschema.table3;
    Disable TRIGGER Trigger4 on myschema.table4;

The user account being used for the database connection has been given the following roles:

SQL Server roles

How do I fix this?

도움이 되었습니까?

해결책 2

The user account required access to myschema. Making the user an owner of myschema through Database User dialog box in SQL Server Management Studio resolved the error.

다른 팁

To disable or enable trigger The user must have ALTER permission on the Table or the View on which trigger was defined/created.

To grant permission to the user on the table you can execute the following statement.

GRANT ALTER ON [dbo].[theTable] TO [User] 
GO
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top