quiTech
asked on
SQL Server procedure to create Database from existing Database
Hello,
Does anyone have a SQL stored procedure that reads an existing database schema (tables, views, procedures, and functions) and creates a query that, when run, would create a blank copy of that existing database?
I know I can do this manually from query analyzer, by right clicking on each object and creating the SQL for it. But, I'm hoping for an automated version :-)
Thanks in advance!
Does anyone have a SQL stored procedure that reads an existing database schema (tables, views, procedures, and functions) and creates a query that, when run, would create a blank copy of that existing database?
I know I can do this manually from query analyzer, by right clicking on each object and creating the SQL for it. But, I'm hoping for an automated version :-)
Thanks in advance!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Simply script the whole Schema in ONE .sql file, create a new DB and run the .sql in it.
ASKER
Hi DireOrbAnt,
I know this question has been open for a long time. Sorry for not replying sooner.
How Do I script "the whole Schema in one .sql"? I know I can click on each individual object, script to clipboard and past into the same window. but this seems rather cumbersome. I'm hoping there is a way to script the whole schema, as you suggest with a single command...
thanks
I know this question has been open for a long time. Sorry for not replying sooner.
How Do I script "the whole Schema in one .sql"? I know I can click on each individual object, script to clipboard and past into the same window. but this seems rather cumbersome. I'm hoping there is a way to script the whole schema, as you suggest with a single command...
thanks
ASKER