April 27, 2010 at 5:58 am
Is there a way to create schemas from database X into database Y? I want to copy all of them from X to Y using T-SQL within an SP (no back and forth between the application and SQL). (SSIS is not available in the edition I'm currently working on)
Database X & Y names are dynamic therefore scripts must often be done dynamically when having cross databases tasks to do.
Unfortunately it's not possible to do something like:
Using DatabaseNameX connection
CREATE SCHEMA DatabaseNameY.NewSchemaName AUTHORIZATION abc
Through dynamic SQL, use database and go cannot be used to switch database and create the schema on the databaseY inside the dymamic sql context (or did I missed something?)
Thank you
April 27, 2010 at 6:19 am
Its difficult. :w00t:
April 27, 2010 at 6:23 am
:hehe: thank you for your support! I've already notice it was hard hence the question 😀
April 27, 2010 at 6:35 am
schema creation is not a very regular activity that need to be created dynamically or using procedures. Its administrative work and usually done whenever required and which is very rare. I wonder why you have such kind of requirement.:-)
April 27, 2010 at 6:39 am
Administrative operations need to be done automatically and autonomously.
Once deployed, there will be no way to go back and check.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply