Rafael Colucci
Rafael Colucci

Reputation: 6078

Gated Build for SQL Server Queries?

We use TFS and we have defined a Gated Build for our project. This build definition ensures that every check in can be reject if the code is broken, but it does not check for broken SQL Scripts.

We have a folder where we put all our SQL Server scripts. But if someone checks in a broken query, even though we have a Gated Build, the server does not validade if the query is broken or not.

Is there any way of creating a Visual Studio Project or change the Gated Build definition to check for broken SQL scripts when somebody checks in?

Upvotes: 0

Views: 258

Answers (1)

John Saunders
John Saunders

Reputation: 161831

Use a Database Project. It can contain the entire database schema plus stored procedures. During a build, it will verify that the stored procedures match the schema.

In addition, a database project can be configured to perform static code analysis on the schema and stored procedures - it will tell you about many mistakes in the code that you didn't realize were there.

Upvotes: 1

Related Questions