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
Going back to the accepted answer for Warnings and Visual Studio 2019:
1) Right click on the database project and select properties Database solution
2) Under "Build" and "Suppress Transact-SQL warnings:" enter the SQL warning number you want to suppress, ex: SQL71502 you enter 71502. You can enter multiple warning suppression codes in a coma delimiter way. Example of suppression codes for unresolved reference to object
3) Save your solution and warning should go away. You might have multiple warning codes to enter in order for the warnings to 0 out.
My workaround (in VS2019) was:
1) Set Build Action to None for this script. => To avoid error messages 2) Create a PostDeployment script (if not present) 3) Add the line :r .\Path_script\script_name.sql => To execute the script when publishing (Add a drop statement before if necessary)
Activate SQLCMD Mode in menu SQL->Execution settings -> SQLCMD Mode
Hope this help.
What i tried and worked for me was select the file in the project: i.e.: projectDatabase\ddl\table_name.sql and on the file properties window set Build Action : None.
In build it doesn't look in this files for errors or warnings.
Little late but hope that help.
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 Visual studio 2017, you can do the following: Go to tools --> options --> SQL server tools --> Under Errors & Warnings, set “Maximum no. of errors & warnings….” as 1.