Allow suppression of a specific Warning on a specific object in a Database Project
I have a few stored procedures in my database project that reference local temporary tables created in another stored procedure. The procedures throw SQL71502 Warnings, that tell me the procedure has an unresolved reference to the temporary table. There is no way to resolve these Warnings within the Database Project, since there is no way for the Database Project to "see" the temporary table created in the other procedure. Therefore, the only choices I have are (1) keep the Warnings in the solution or (2) suppress all Warnings of type SQL71502 in the project. Neither approach is optimal. Keeping these Warnings just creates noise in the development environment, while suppressing ALL Warnings of this type might lead me to miss an unresolved reference that CAN be resolved. I would like to see a feature that would allow me to suppress a specific Warning on a specific object. This way I can remove the Warning from the development environment without having to suppress all Warnings of that type.
Thanks for taking the time to share this suggestion. This item has been around for a couple of versions of Visual Studio and we haven’t acted on it. Looking at the VS “15” plans, we’re not going to take action on this item, so we’re going to close it. If the suggestion is still relevant, please either take a look to see if there’s another suggestion that’s similar that you can vote on, or open a new suggestion.
- The Visual Studio Team
Eric Mamet commented
I think you could also suppress the warning message by fooling SSDT.
In your stored procedure, add a piece of code like this
IF 1 = 2 CREATE TABLE #YourTable(blah blah blah)
This seems to do the trick for me with SSDT 2013
Gert Drapers commented
Sorry, it was there in the VS 2010 database projects as well.
Ah, that's perfect! This should be publicized a little more. I've been working with the database projects for years and didn't know that the warnings could be suppressed at the file level.
Gert Drapers commented
You can supress TSQL warnings at the file level as well, look at the properties on the files "Suppress TSql Warnings", besides the project file. There is no object level suppression as there is no standard attribution construct in the TSQL language to achieve this. A XML comments like idea would come closed.