Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Create multiple stored procedures

Posted on 2006-06-09
3
Medium Priority
?
252 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 2000 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 43

Expert Comment

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

Featured Post

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

715 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