Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Torch
Starting Member
20 Posts |
Posted - 2005-07-13 : 23:32:47
|
| I created an SQL script of one of my databases - containing tables and stored procedures.I want to put this script in a stored prcedure in a different database. However I can't do this as then I will be creating stored procedures within a stored procedure. Is there a way around this problem?Torch. |
|
|
Kristen
Test
22859 Posts |
Posted - 2005-07-14 : 00:29:16
|
| Are you trying to create a process to build a complete database, including all tables, procedures, etc.?Kristen |
 |
|
|
Torch
Starting Member
20 Posts |
Posted - 2005-07-14 : 04:24:21
|
| Yes, creating the tables is straight forward however I get syntax errors when trying to create stored procedures within the main stored procedure. |
 |
|
|
mmarovic
Aged Yak Warrior
518 Posts |
Posted - 2005-07-14 : 04:33:38
|
You mean you want to execute 'create procedure ...' inside your stored procedure? If so use dynamic sql.declare @cmd varchar(8000)...set @cmd = ...exec (@cmd) |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2005-07-14 : 11:28:00
|
| Probably easiest to have a file containing the script to build the database, and run that.What are you running it from, client application? Does it have file access to the box that SQL Server is on?Kristen |
 |
|
|
|
|
|