2017-02

2016-09

2016-06

2016-03

2016-01

returning DBCC CHECKDB results from a temp table, which was populated by running DBCC DBINFO against each database hosted on the SQL instance. I shared a query that returned any databases that had not had a CHECKDB run against it for over 7 days. The query is below:

 
select dbi.Value from #db dbi
WHERE field LIKE '%lastknow%'
AND (CASE WHEN isDate(dbi.value) = 1 THEN CAST (dbi.Value AS DATETIME2(3))END) < DATEADD (DAY,-7, GETDATE())

That “CASE” statement stands out quite a bit doesn’t it. Let’s explore why this query needs a CASE expression. Begin by creating a temp table that contains a sample of the data stored in the temp table.

2015-11

2015-10

2015-08

2015-06

2015-02

2015-01

2014-10

LowerMemoryLimit and the UpperMemoryLimit, and once these are set, they are set in stone right?

Right?

2014-09

2014-07

2014-06

Connect article already open.

2014-05

2014-03

2014-02

2013-12

2013-09

2013-04

2013-03