cookieChoices = {};

Wednesday, 4 May 2016

List of Stored procedure created in last N days

List of Stored procedure created in last N days


SELECT name,sys.objects.create_date  
  
FROM sys.objects  
  
WHERE type='P'  
  
AND DATEDIFF(D,sys.objects.create_date,GETDATE())< N  

List of Stored procedure modified in last N days

List of Stored procedure modified in last N days


SELECT name,modify_date  
  
FROM sys.objects  
  
WHERE type='P'  
  
AND DATEDIFF(D,modify_date,GETDATE())< N

Disable and Enable All Trigger for database

Disable and Enable All Trigger for database


Use Database_Name  
  
Exec sp_msforeachtable "ALTER TABLE ? DISABLE TRIGGER all"


Use Demo  
  
Exec sp_msforeachtable "ALTER TABLE ? ENABLE TRIGGER all"

Disable and Enable All Triggers of a table

Disable and Enable All Triggers of a table

ALTER TABLE Table_Name DISABLE TRIGGER ALL 

ALTER TABLE Table_Name ENABLE TRIGGER ALL

Enable a Particular Trigger SQL

Enable a Particular Trigger SQL

ALTER TABLE Table_Name ENABLE TRIGGER Trigger_Name

Disable a Particular Trigger SQL

Disable a Particular Trigger SQL

ALTER TABLE Table_Name DISABLE TRIGGER Trigger_Name

Retrieve Free Space of Hard Disk

Retrieve Free Space of Hard Disk


EXEC master..xp_fixeddrives