a list of useful functions to rename or massively create tables in a Microsoft SQL sever database (Transact-SQL)

–-Create scripts for All Procs
SELECT SM.definition
FROM sys.sql_modules SM
INNER JOIN sys.Objects SO
ON SM.Object_id = SO.Object_id
WHERE SO.type = ‘p’
 
-–Create scripts for All Views
SELECT SM.definition
FROM sys.sql_modules SM
INNER JOIN sys.Objects SO
ON SM.Object_id = SO.Object_id
WHERE SO.type = ‘v’
   
-–Create scripts for All Functions
SELECT SM.definition
FROM sys.sql_modules SM
INNER JOIN sys.Objects SO
ON SM.Object_id = SO.Object_id
WHERE SO.type = ‘FN’
Facebooktwitterredditpinterestlinkedinmail