Posts

Showing posts with the label Microsoft SQL Server

SQL Server configure enable xp_cmdshell

EXEC sp_configure 'show advanced options', 1 GO RECONFIGURE GO EXEC sp_configure 'xp_cmdshell', 1 GO RECONFIGURE GO

SQL Server Query Statement Get Last Previous Working Day

SELECT DATEADD ( DAY , CASE DATENAME ( WEEKDAY , GETDATE ()) WHEN 'Sunday' THEN -2 WHEN 'Monday' THEN -3 ELSE -1 END , DATEDIFF ( DAY , 0 , GETDATE ()))