Solved

Create multiple stored procedures

Posted on 2006-06-09
3
240 Views
Last Modified: 2008-02-20
SS2000

What is the most efficient way to create numerous (about 100) stored procedures from individual .sql code files?  I really don't want to deal with them individually.  Is there some way to quickly concantenate them into one file?

Thanks
tguillor
0
Comment
Question by:tguillor
3 Comments
 
LVL 35

Expert Comment

by:YZlat
ID: 16871055
you could put all the file names into an array.
Then loop through the array, retrieving file names.
The open each file and run the code
0
 
LVL 50

Accepted Solution

by:
Lowfatspread earned 500 total points
ID: 16871140
do use want to use the dos for command to just invoke the osql utility to compile your procedures?

eg in DOS

FOR %a IN (*.SQL) DO ECHO OSQL -I%a -O%a.OUT -E -SSERVERNAME -DDATABASENAME >> A.bat

then

a.bat ...

assuming you use a trusted connection -E

hth
0
 
LVL 42

Expert Comment

by:Eugene Z
ID: 16871500
open query analyzer and open the .sql  and run
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SqlServer Table Triggers 3 28
MSSQL join different row from other table 14 65
sql server stored procedure parameter 10 20
SQL Query Syntax error after > 11 39
Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how the fundamental information of how to create a table.

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question