Home

Awesome

TSQL-Smells

TSQL Smells Finder - SSDT

TSQL Code can smell, it may work just fine but there can be hidden dangers held within. Code that works just fine one day can break if the database schema changes underneath.

This project extends the Static Code Analysis rules inside SSDT, and therefore msbuild, to test that code meets certain rules. Each rule is individually selectable to be active and to have "Warnings as Errors". There are presently 43 rules covering:

Whitelisting of objects is supported with extended properties. Add to you project a script which sets the name of WhiteList against an object to be ignored. For example :

EXEC sys.sp_addextendedproperty @name=N’WhiteList’, @value=N’Ignore’ , @level0type=N’SCHEMA’,@level0name=N’dbo’, @level1type=N’PROCEDURE’,@level1name=N’WhiteListTestProc’

Further install instructions can be found on my blog here : http://dataidol.com/davebally/2015/03/23/getting-out-of-the-ground-with-tsql-smells/