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
2 answers

Multiple Assertions using tSQLt

I am trying to check whether a table exists or not in the database using AssertObjectExists. Actually I have 10 tables to check whether those tables exists or not. Since the test is verification of existence of tables. I want to put together in one…
vkrams
  • 7,267
  • 17
  • 79
  • 129
0
votes
1 answer

tSQLt FakeTable fails when user-defined date types are used

I got the following error when I tried to fake a table that uses user-defined data types. COLLATE clause cannot be used on user-defined data types.{,1} It looks like it's a known issue in tSQLt.…
stonetiger
  • 96
  • 4
0
votes
2 answers

Can't update table

So right now I have a simple SQL store procedure which I can call to update one of the tables in my database. Within the store procedure, I have an If conditional statement: IF 1 > 0 THEN UPDATE TABLE_A SET COLUMN_1 =299999 …
sicccccc
  • 25
  • 4
0
votes
2 answers

FakeTable with tSQLt remove triggers

I have jsut started to use tSQLt and is about to test a trigger. I call the FakeTable procedure and do my test but the trigger is not executed. If don't use FakeTable the trigger is executed. That seems to be really bad and I canät find any info…
user1454695
  • 67
  • 1
  • 5
0
votes
1 answer

T-SQL to group results by a range of possible values

Not sure how to word the question: I have a query such as SELECT s.* FROM SUMMARY s WHERE s.TYP = 'A' AND s.NUM > 0 AND s.NUM <= 999999 and a group by like SELECT s.TYP, s.COUNT(TYPE) FROM SUMMARY s GROUP BY s.TPY which gives: A 38720 B 39500 C…
BlueChippy
  • 5,935
  • 16
  • 81
  • 131
-1
votes
1 answer

tsqlt and dynamic sql

I am trying to test a sproc which uses dynamic sql like this: DECLARE @Sql NVARCHAR(MAX) -- create @Sql EXEC sp_executesql @Sql ,N'@NumberOfRollingMonths INT, @FromDate DATETIME, @ToDate DATETIME' ,@NumberOfRollingMonths =…
cs0815
  • 16,751
  • 45
  • 136
  • 299
-2
votes
2 answers

tSQLt test cases for database insert and update via stored procedures

I want to write tSQLt test cases for database insert and update via stored procedures. I followed the official documentation of tSQLt and installed CLR into the database. I can see multiple tables and hundred of stored procedures are imported when…
Nagendra Bhat
  • 43
  • 1
  • 9
-4
votes
1 answer

Split row values to columns?

Input Table Id 1,2,3 6,8,1,2,5 4,9,2,1 6,7,8 I need output like this Id1 id2 id3 id4 id5 1 2 3 Null Null 6 8 1 2 5 4 9 2 1 Null 6 7 8 Null Null
1 2 3
13
14