Tuesday 21 February 2017

Drop All Tables from database using sql query at a time


///   Query


SELECT 'DROP Table [' + TABLE_CATALOG + '].[' + TABLE_SCHEMA + '].[' + TABLE_NAME + ']'

FROM INFORMATION_SCHEMA.TABLES


///   Result

DROP Table [DBName][dbo].[HH_Get_Sec_91]
DROP Table [DBName][dbo].[HH_Get_Sec_92]
DROP Table [DBName][dbo].[HH_Get_Sec_9]
DROP Table [DBName][dbo].[HH_Get_Sec_8]
DROP Table [DBName][dbo].[HH_Get_Sec_7_Social]



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 ,","...