MS SQL - Random Tips

Stored Procedure

Create Procedure spName
(
	@InputDate datetime = NULL
)
AS
    if @InputDate is null
        set @InputDate = GETDATE()
create procedure name
with encryption

Database management

dbcc shrinkdatabase (DatabaseName,truncateonly)
dbcc shrinkfile (DatabaseName_log, 10, truncateonly)