?
Solved

MS SQL 2012: Unit Test for Database/Stored Procedures

Posted on 2013-01-14
3
Medium Priority
?
717 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 1000 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 1000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
This shares a stored procedure to retrieve permissions for a given user on the current database or across all databases on a server.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Suggested Courses

850 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