Solved

Create multiple stored procedures

Posted on 2006-06-09
3
208 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:EugeneZ
ID: 16871500
open query analyzer and open the .sql  and run
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

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 …
Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

760 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now