August 6, 2008 at 8:56 pm
In SSMS As i try to disable the trigger with following statement
DISABLE TRIGGER triggerName ON databasename..tablename
i get following error
Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword 'TRIGGER'.
What may be reason for that
Take care
DBDigger Microsoft Data Platform Consultancy.
August 6, 2008 at 9:05 pm
The syntax looks correct. Make sure you do not have the code partially highlighted or you may get this error message.
August 6, 2008 at 9:39 pm
DDL statements do not usually accept a Database name.
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
August 6, 2008 at 9:50 pm
rbarryyoung (8/6/2008)
DDL statements do not usually accept a Database name.
I was able to disable a trigger on my test database using the dbname..tablename syntax. I wonder if it is a version thing.
August 6, 2008 at 10:02 pm
Is your database set to compatability level 80 (SQL 2000) ?
August 6, 2008 at 10:10 pm
Disable Statement accepts Database Name. The syntax is correct if the table on which you are performing Disable Trigger operation is in the dbo schema. But in this case, the error should be different.
BUT I am unable to re-generate the error in Query window.
Are you trying to disable triggers in a stored procedure? If this is the case, try using ';' after each Disable statement.
Atif Sheikh
August 6, 2008 at 11:21 pm
DISABLE TRIGGER is a SQL 2005 command. If your database compatability is below 90, it is not supported. You will need to use the equivalent ALTER command instead.
If you don't have a requirement to remain in 80 compatability, change it to 90 and you can use the DISABLE TRIGGER command.
Viewing 11 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply