In SQL Server Data Tools, I would like to suppress some, but not all, occurrences of SQL71502 ("--- has an unresolved reference to object ---"). I know I can suppress through Project Properties, Build, Suppress Transact-SQL warnings, but this will globally suppress. Can this be done?
You can suppress it at individual file level which contains the code generating the warning if you want. Something like this.
<Build Include="Stored Procedures\X.sql">
<SuppressTSqlWarnings>71502</SuppressTSqlWarnings>
</Build>
You weren't clear on what would determine which 71502 messages would be suppressed and which ones wouldn't but based on my own understanding and research I think the answer is the same. In short, no.
You can suppress all warnings, or warnings based on a specific code ( 71502 ) but that is as granular as it gets.
http://msdn.microsoft.com/en-us/library/hh272681(v=VS.103).aspx
This link talks about promoting warning to errors but also demonstrates how the suppress filter is used - which based on your question you probably already know.
http://social.msdn.microsoft.com/Forums/is/ssdt/thread/9b698de1-9f6d-4e51-8c73-93c57355e768
It sounds like you're trying to do this at the object/file level, like a sproc.
If this is the level of granularity you're wanting, then, with the project open, select the object and in the properties is an option to Suppress TSql Warnings, enter 71502 and that should do it.
Other warnings for the object will still be raised - as will 71502 warnings in other objects.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With