Questions tagged [tsqlt]

tSQLt – The Database Unit Testing Framework for SQL Server

tSQLt is a database unit testing framework for Microsoft SQL Server. tSQLt is compatible with SQL Server 2005 (service pack 2 required) and above on all editions. It is available at tSQLt.org

204 questions
0
votes
1 answer

Why is TSQLT erroring out in SQLTest and not running when run manually?

I have a set of tests that run sometime when run through Redgate SQLTest and sometimes they give me the first error in the screenshot. When running my test code manually it takes about 22 seconds to execute. Also when I run manually with the…
Cole Mietzner
  • 303
  • 1
  • 5
  • 13
0
votes
1 answer

SQL Data verification framework?

I receive a variety of flat files that need to be transformed and aggregated in several stages of an ETL process before loading it into a SQL Server database. After each stage, I'd like to verify the data in several ways, and I'm looking into…
Richard
  • 389
  • 1
  • 13
0
votes
0 answers

SSIS package does not trigger when using tSQLt Run command

I am trying to write integration tests for SSIS packages. The SSIS package has been deployed to the SSIS catalog (SSISDB). I am using a server with the Winders Server 2012 OS, and am using SQL Server 2012 My code is below EXEC tSQLt.NewTestClass…
GreenyMcDuff
  • 3,292
  • 7
  • 34
  • 66
0
votes
1 answer

How can I test memory optimized tables using tSQLt?

Currently, when I try to unit test stored procedures using tSQLt, if my test touches a Memory Optimized table, I receive the following error: (Error) Creating a savepoint is not supported with memory optimized tables.[16,98] (There was also a…
Steve
  • 1,779
  • 1
  • 11
  • 12
0
votes
1 answer

AssertResultSetsHaveSameMetaData in TSQLT

I am using TSQLT AssertResultSetsHaveSameMetaData to compare metadata between two tables.But the problem is that i cannot hardcode the table name since i am passing the table name as the parameter at the runtime.So is there any way to do that
0
votes
1 answer

tSQLt simple SELECT statement - what tests do I need? Best practice

This is a question about tSQLt / SQL testing best practice. Assume I have a stored procedure that returns the results of a simple SELECT statement e.g. SELECT A.Column1 , B.Column2 FROM TableA AS A INNER JOIN TableB AS B ON A.ID =…
The Dumb Radish
  • 886
  • 7
  • 18
0
votes
1 answer

tsqlt- Not working with Non Clustered Columnstore Index

I am trying to create a unit test on a procedure which touches a non-clustered columnstore table. I create a fake table and then tried both dropping and disabling the CStore index before inserting test data but when I try to run the test, it always…
Saugat Mukherjee
  • 778
  • 8
  • 32
0
votes
2 answers

tsqlt ways to test stored procedures producing files as output

I have a stored procedure which created a file using BCP. I need to validate the data in the file with a predefined expected resultset. Is there a way this can be tested using TSQLT?
user2239309
  • 11
  • 1
  • 2
0
votes
3 answers

How to apply an index to a faked table in tSQLt

Using the excellent tSQLt testing framework (v1.0.5137.39257) for MS SQL Server (2012), I'm trying to build a test to check that a UNIQUE INDEX works and generates an exception when a duplicate value is inserted. After extensive searching, I cannot…
Reversed Engineer
  • 1,095
  • 13
  • 26
0
votes
1 answer

The procedure after spyProcedure is not being called ...How to resolve this

I am trying to use the spyProcedure , but it is not working as expected. Below is the scenario please help me where am I doing wroing? **CREATE PROC [dbo].[proc3](@id int , @marks int out) as begin select @marks = marks from student where…
BdEngineer
  • 2,929
  • 4
  • 49
  • 85
0
votes
2 answers

Progress feedback while executing tSQLt.RunAll

Is there a way to get any feedback from tSQLt.RunAll while it is running. On a very big project with high % DB Unit Test coverage this command takes ages. I would like to be able to see (and display) a progress of this command. Is it possible?
Amoenus
  • 118
  • 7
0
votes
1 answer

How to convert datetime fileds to UTC Datetime for existing data in the database?

How can I change the Datetime values for the existing data to UTC Time? Is any inbuilt SQL qry available to change? Eg. Existing Data in the table CreatedON 2013-03-01 08:12:00.000 2013-03-01 13:15:18.000 2013-03-01 13:10:00.000 Need to convert…
SESHI
  • 33
  • 2
  • 7
0
votes
2 answers

SQL View union from joiner table

I have the following situation and I am not sure how best to address it. Any guidance on how to prepare the needed view would be greatly appreciated. I have 4 tables: users (userid int, username varchar) roles (roleid int, rolename…
Aossey
  • 850
  • 4
  • 13
0
votes
1 answer

tSQLt AssertEqualsTable - unexpected results when table schema doesn't match

I noticed the other day that you can write a test where there are more columns in the Actual table that in the Expected table and the test will still pass if the the data matches in the columns that exist in both. Here is an example: if…
Andrew
  • 5,215
  • 1
  • 23
  • 42
0
votes
1 answer

SQL Randomise rows based on date and int to only change results order daily

I would like to generate a "random" integer for each row returned from a select statement where the random int only changes once per day (before and after 4am). Example declare @Date datetime set @Date = dateadd(dd, 8, GETDATE()) declare…
1 2 3
13
14