SQL Code Guard

I ran across a free SSMS add-in SQL Code Guard. The add-in can run analysis on scripts to detect possible code issues, as well as display the dependencies for a database object. The add-in is also available through Redgate(along with some other free add-ins).

After downloading, unzip the file and run the EXE. The add-in will be installed in SSMS(Any version from 2005 onward). Both Chrome and Norton identified the file as a possible risk, since it doesn’t have a large number of downloads. Also, I needed to add a line to the SSMS.exe.config file under configuration/runtime(otherwise SSMS takes a long time to open).

Add-Ins: This is just a link to the Redgate site to list the other SSMS add-ins.
Run Analyze: This was the most useful function to me. This will analyze a script (or database object) for possible issues, things like an object reference without a schema name, an asterisk in a SELECT, deprecated SET options, etc.
Show Dependencies: Once a database is selected in the Object Explorer, this will list each database object with the objects it depends on as well as objects that refer to it. For a table, you can see the referring objects broken down by insert, update and so on.
Code Outline: This will break down a script into the operations that it performs. For example, if a table is being created, the outline will show CREATE TABLE dbo.Table. Clicking on that item will take you to that section of the script. So if you have a complicated script, this will help you to navigate to certain operations.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: