Tuesday, 21 February 2017

Drop All procedures from database using sql query at a time

/// Query

SELECT 'DROP PROCEDURE [' + SCHEMA_NAME(p.schema_id) + '].[' + p.NAME + ']'

FROM sys.procedures p


/// REsult

DROP PROCEDURE [dbo].[HH_Get_Sec_91]
DROP PROCEDURE [dbo].[HH_Get_Sec_92]
DROP PROCEDURE [dbo].[HH_Get_Sec_9]
DROP PROCEDURE [dbo].[HH_Get_Sec_8]
DROP PROCEDURE [dbo].[HH_Get_Sec_7_Social]

// now execute command and drop all procedure related to the DB

No comments:

Post a Comment

How to highlight selected text in notepad++

  –> To highlight a block of code in Notepad++, please do the following steps step-1  :- Select the required text. step-2  :- Right click...