﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Administering / SQL Server 2005  / about storing sql script in a table? / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Fri, 24 May 2013 09:43:43 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: about storing sql script in a table?</title><link>http://www.sqlservercentral.com/Forums/Topic1412176-146-1.aspx</link><description>Certainly. Code repository systems work on this concept.</description><pubDate>Thu, 11 Apr 2013 16:38:20 GMT</pubDate><dc:creator>mmartin1</dc:creator></item><item><title>RE: about storing sql script in a table?</title><link>http://www.sqlservercentral.com/Forums/Topic1412176-146-1.aspx</link><description>[quote][b]mpradeep23 (1/27/2013)[/b][hr]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 thisthankswith best regardspradeep[/quote]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.</description><pubDate>Tue, 29 Jan 2013 08:09:27 GMT</pubDate><dc:creator>wolfkillj</dc:creator></item><item><title>RE: about storing sql script in a table?</title><link>http://www.sqlservercentral.com/Forums/Topic1412176-146-1.aspx</link><description>[quote][b]mpradeep23 (1/27/2013)[/b][hr]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 [/quote] 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</description><pubDate>Mon, 28 Jan 2013 04:03:51 GMT</pubDate><dc:creator>Bhuvnesh</dc:creator></item><item><title>about storing sql script in a table?</title><link>http://www.sqlservercentral.com/Forums/Topic1412176-146-1.aspx</link><description>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 thisthankswith best regardspradeep</description><pubDate>Sun, 27 Jan 2013 22:14:33 GMT</pubDate><dc:creator>mpradeep23</dc:creator></item></channel></rss>