Tuesday 21 February 2017

Drop All User-Defined Types from SQL Server database at a time

//////  Query

Select  'DROP TYPE ' + quotename(schema_name(schema_id)) + '.' + quotename(name) from sys.types

Where is_user_defined = 1


// // REsult

DROP TYPE [dbo].[Type_tblHH]
DROP TYPE [dbo].[Type_tblHH_ConsumerGoods]
DROP TYPE [dbo].[Type_tblHH_Crops]
DROP TYPE [dbo].[Type_tblHH_Deceased]

DROP TYPE [dbo].[Type_tblHH_DrinkingWater]


run execute command and get result

No comments:

Post a Comment

Excel Sort values in ascending order using function TEXTJOIN

 Excel ::  Text ::  1,3,5,2,9,5,11 Result :: 1,2,3,5,5,9,11 Formula ::     TEXTJOIN ( ",",1,SORT(MID(SUBSTITUTE( A1 ,","...