Suppress Database Project errors and warnings in visual studio 2010

I have an Database project in my application and want to suppress the errors/warnings thrown by this project. .first of all is it possible ?

I think I was not clear with my question, by suppressing I meant that when I build my Solution, the errors(which actually are not errors) are shown in the error list, I just want that all Database project related errors should not be shown in the error list.

I am using VS2010.

thanks in advance


To surppress a specific warning, go to project properties -> Build.

Type in the warning numbers (i.e. without 'SQL') in comma delimited format in field "Suppress Transact-SQL warnings:".


Select the file in the project:

example: projectDatabase\ddl\table_name.sql

on the Properties Window of the file set

Build Action : None.

While building it doesn't look in this files for errors or warnings.


Just had this problem in Visual Studio 2015.

Halfway along the header of the Error List panel, there is a (unnamed) dropdown with values 'Build + Intellisense', 'Build Only', 'Intellisense Only'. Mine was set to 'Build + Intellisense'. Changing it to 'Build Only' got rid of all the (200+) errors.


better late than never:

Options -> Database Tools -> Databse Errors and Warnings -> set the maximum at 0 and from now on the error window will have a single entry that will say something like

Error 1 The maximum number of 0 errors has been reached. 76 total errors, 0 total warnings, and 0 total messages were encountered.

--EDIT-- FROM THE COMMENT BELOW...VERY HELPFUL
In VS 11 it appears this option has moved to Tools > Options > SQL Server Tools > General


In VS 2015, you can suppress the warning 2 ways.

Project Level

I don't suggest this because I only like suppressing warnings if I know exactly what I am suppressing. In C#, for example, we can use SuppressMessageAttribute at a very granular level.

Nonetheless, here is how:

Right click database project > Properties > Build > Suppress Transact-SQL Warnings:

Enter the warnings you want to suppress such as 4151.

File Level

I prefer/suggest this option because it is more granular compared to above option.

Right click file in solution explorer1 > Properties > Suppress T-SQL Warnings

Enter the warnings you want to suppress such as 4151.


1. You must right click the file node in solution explorer. You will get a different options if you right click the file in editor.

There may exist another way but I only know of these 2 ways thus far.