Tuesday, December 9, 2008

TSD01261: The syntax check failed 'Incorrect syntax near ].' in the batch near '] '

Problem: Database Project fails to build with warning: The syntax check failed 'Incorrect syntax near ].' in the batch near ']. Project also fails to show the exact location of the error:

Source of the Problem:
I've found this to occur when the following two things happen together:
  1. You have a variable defined for the project that isnt set.
  2. You are using an ALTER AUTHORIZATION ON DATABASE statement with this variable.
Fix:
As you would expect, the fix here is to set the variable correctly since the real problem here is that visual studio doesn't tell you where the problem is occurring.

No comments: