January 27, 2013 at 10:14 pm
Hi
Can i store the database creation script in a table call the script in stored procedure to create new database with tables and stored procedure
can any one give me idea about this
thanks
with best regards
pradeep
January 28, 2013 at 4:03 am
mpradeep23 (1/27/2013)
Can i store the database creation script in a table call the script in stored procedure to create new database with tables and stored procedure
Yes this can be done but if you rather create .sql files and then call them with the help of sqlcmd then that will be much simpler and easy to troubleshoot
-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done;-)
January 29, 2013 at 8:09 am
mpradeep23 (1/27/2013)
HiCan i store the database creation script in a table call the script in stored procedure to create new database with tables and stored procedure
can any one give me idea about this
thanks
with best regards
pradeep
Yes, but you will have to use dynamic SQL to actually execute scripts stored in a table as character strings. Set a variable of datatype (n)varchar with adequate scale equal to the result of the SELECT statement that returns the query you want, then run the sp_executesql system stored procedure with that variable as the input parameter value.
Jason Wolfkill
April 11, 2013 at 4:38 pm
Certainly. Code repository systems work on this concept.
----------------------------------------------------
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply