Arjun SreeVastsva
SSCertifiable
Points: 7152
More actions
October 25, 2017 at 8:06 pm
#340245
hi,
i need to create single table in nearly 50 schemas.can anyone provide automation script for this
Phil Parkin
SSC Guru
Points: 247180
October 25, 2017 at 8:28 pm
#1965269
Arjun SreeVastsva - Wednesday, October 25, 2017 8:06 PMhi,i need to create single table in nearly 50 schemas.can anyone provide automation script for this
Use Excel formulas ... simple.
SQLPirate
SSCrazy
Points: 2880
October 26, 2017 at 11:15 am
#1965363
Something like this will generate all the create statements...
SELECT 'CREATE TABLE ['+name+'].[YourTable] ( ID INT )GO'FROM sys.schemas where principal_id = 1
Then you'd just need to copy/paste/execute
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply