Monday, August 19, 2013

Drop All Stored procedures,views and functions - GET Objects from sys.objects


 GET Objects from sys.objects
--select *from sys.objects where type in('P','V','FN') order by type


--Query for stored procedure
select ('DROP PROCEDURE ' + NAME),*from sys.objects where type in('P') order by type

--Query for view
select ('DROP VIEW' + NAME),*from sys.objects where type in('V') order by type

--Query for FUNCTIONS
select ('DROP FUNCTION' + NAME),*from sys.objects where type in('FN') order by type

No comments:

Post a Comment