Solved

MS SQL 2012: Unit Test for Database/Stored Procedures

Posted on 2013-01-14
3
705 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 38

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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
DTS Connection Failed 7 66
export sql results to csv 6 34
create an aggregate function 9 31
Can > be used for a Text field 6 37
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
I have a large data set and a SSIS package. How can I load this file in multi threading?
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

808 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