Sleep Command In Sql Server


Most programming languages have a command that allows a process to sleep (or wait) before continuing.  SQL Server is no exception.  Since SQL Server 2005 there has support for a sleep command through the use of the WAITFOR command.

Read more

How To Format A Number With Commas


SQL Server 2012 makes it a lot easier to format a number with commas, but let’s face it… previous versions haven’t been so nice to us.  Here are the easiest ways that I know to format a number with commas.

SQL Server 2012+

SELECT	FORMAT(1234567890, '###,###,###') AS 'FormattedNumber'

SQL Server 2008 And Previous

SELECT	REPLACE(CONVERT(VARCHAR(50), (CAST(1234567890 AS money)), 1), '.00', '') AS FormattedNumber