none
Treat specific warning as error? RRS feed

  • Question

  • Is it possible to treat a specific warning as an error in a database project? We aren't able to treat all warnings as errors so we can't use the atomic option.

    I saw a discussion about setting all the warnings as errors except for a list. That's handled via the "WarningsNotAsErrors" tag so I gambled and tried "WarningsAsErrors". That seems to be a valid property for the csc compiler but I don't know that it's used for .sqlproj files. At any rate, if I put the desiredwarning I want elevated to an error in there, I get a warning that the supplied warning number is not valid. 

        <WarningsAsErrors>71502</WarningsAsErrors>

    Looking at the project xml, it looks like I should be be able to add TSql to a tag and it might work

         <TreatTSqlWarningsAsErrors>False</TreatTSqlWarningsAsErrors>
        <SuppressTSqlWarnings></SuppressTSqlWarnings>

    But to no avail

        <TSqlWarningsAsErrors>71502</TSqlWarningsAsErrors>

    So, is there any option to selectively promote a warning to error with SSDT?

    SQL71502/71502 is an unresolved reference warning


    • Edited by billinkcMVP Friday, February 17, 2012 6:27 PM Fixed title
    Friday, February 17, 2012 6:26 PM

Answers

  • Hi billinkc,

    SSDT doesn't offer a way to promote specific warnings as errors.  The closest way to achieve this behavior is to treat all warnings as errors, then suppress build warnings at the file level via File Properties.

    -Janet Yeilding


    Tuesday, March 6, 2012 2:45 AM