Solved

MS SQL 2012: Unit Test for Database/Stored Procedures

Posted on 2013-01-14
3
707 Views
Last Modified: 2013-01-21
Hi!

I'm looking for some tips (best practice) how to unit test stored procedures in MS SQL 2012?

I found TSQLUnit and tSQLt, but is there any other or better ways to unit test a database.
0
Comment
Question by:ulf-jzl
3 Comments
 
LVL 39

Assisted Solution

by:Aaron Tomosky
Aaron Tomosky earned 250 total points
ID: 38776740
redgate stuff is expensive but awesome
http://www.red-gate.com/products/sql-development/sql-test/
0
 
LVL 28

Accepted Solution

by:
Ryan McCauley earned 250 total points
ID: 38783510
There's also an integrated Visual Studio option if you have the Data Tools installed:

http://blogs.msdn.com/b/ssdt/archive/2013/01/03/new-blog-post.aspx

The Red Gate products are generally top-notch - though expensive, they're awesome. In particular, it looks like the SQL Test product is actually a wrapper for tSQLt, using the APIs from that framework to execute the tests designed and managed in the Red Gate product.

I'm not sure what your situation is (if you're doing personal projects or working with a company), but I suspect the $300 price tag to pick up SQL Test is money well spent - if you're a developer making $75K, $300 is a single day's pay.
0
 

Author Closing Comment

by:ulf-jzl
ID: 38804267
Thx guys!
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question