Error:

Getting the following error when trying to build SQL project…

Only one statement is allowed per batch. A batch separator, such as ‘GO’, might be required between statements.

Fix:

I have found the problem. When I added the file in VS I forgot to set Build Action = None from the file properties. So changing that fixed the problem and the project now compiles.

Go to that file -> Properties

Set the “Build Action” to “None”

References:

https://stackoverflow.com/questions/18698481/error-in-sql-script-only-one-statement-is-allowed-per-batch

Last modified: March 12, 2025

Author

Comments

Write a Reply or Comment