TSQL – Getting every day of the Current Month

This came handy, when i wanted to get all dates of the current month when joining with mutiple tables… and not all the tables  had all dates of the month

;WITH
   CTE0 AS(SELECT 1 AS c UNION ALL SELECT 1),
    CTE1 AS(SELECT 1 AS c FROM CTE0 AS A, CTE0 AS B),
CTE2 AS(SELECT 1 AS c FROM CTE1 AS A, CTE1 AS B),
CTE3 AS(SELECT 1 AS c FROM CTE2 AS A, CTE2 AS B),
  SeqNumbers AS(SELECT ROW_NUMBER() OVER(ORDER BY c) AS SeqNumber FROM CTE3)

SELECT SeqNumber,CONVERT(VARCHAR(12),(GETDATE()-(DAY(GETDATE())-SeqNumber)),101) AS ReportingDate
FROM
    SeqNumbers
WHERE SeqNumber <=    DAY(GETDATE())

Installing SQL Server 2008 Express with Advanced Services

My First Impression

Even if you don’t upgrade your older SQL database (2000 or 2005) to SQL Server 2008 Express, I see lot of benefits using the new SQL Management Studio that comes part of the SQL Server 2008 Express. The New Management is free and backwards compatible with older SQL Servers.

The Advanced Services also includes the Reporting Services and Visual Studio (SQL Server Business Intelligence Studio) for developing reports.

image

Code Completion

This is very good compare to nothing, but I still feel it could have been better, may be the basic feature limitation.. the code completion appears only on the TSQL Statements, I mean it could be nice if I type SET and shows the possible SET options like NOCOUNT ON/OFF

image

 

 

 

 

 

 

 

 

 

 

 

 

 

image

image

DTS

DTS is back and it is good for simple export/import, but unfortunately, we can’t save the DTS package.

image