Skip to content

Tag: sql-server

Select carried over reports

How do I get the carried over reports + the very first report from the following table? Result should be : 304, 306, 309, and 312. CREATE TABLE [dbo].[test]( [reportID] [int] NOT NULL, [caseID] [int]…

tSQLt apply NOT NULL constraint

How do I apply the NOT NULL constraint back onto a column of a table in tSQLt? CREATE OR ALTER PROCEDURE [test abc].[test abc1] AS BEGIN — Arrange EXEC tSQLt.FakeTable ‘dbo’, ‘table1’; –…

Using ISNULL or COALESCE on date column

I’ve got a date column where some rows have got NULL values. I would like to use ISNULL or something like that to substitute those values with something like ‘N/A’, however, when I try to use ISNULL, I get an error due to two different data types. If I try to convert my Date column to VARCHAR in order to…