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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 I need a script which will compile stored proc one by one from the fileVisual Source safe directory

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-12-20 : 09:23:43
cadila writes "I need a script which will compile stored proc one by one from the fileVisual Source safe directory"

nr
SQLTeam MVY

12543 Posts

Posted - 2001-12-20 : 14:39:43
I use a dos redirection script.
Run this inthe root directory for the database with the SP scripts the a procs directory.
The scripts here are named proc1.sql, proc2.sql.
It will create a procs_DBNAME.sql in the root directory and add a use statement for DBNAME at the beginning.
You must have a go (followed by a newline) at the end of every script - if you don't you can add one to this generator.
You could generate this from t-sql if you don't want to type all the proc names in.
I also have a VB app which will concatenate every file in a directory.

See www.nigelrivett.com for how I expect sourcesafe to be used - it should be updated with more info soon now that I have time.

ECHO use DBNAME > "procs_DBNAME.sql"
set fname=
set fdest=..\procs_DBNAME.sql

cd Procs
ECHO print 'Procs' >> "%fdest%"

set fname=proc1.sql
ECHO. >> "%fdest%"
ECHO print 'processing file - %fname% ' >> "%fdest%"
TYPE "%fname%" >> "%fdest%"

set fname=proc2.sql
ECHO. >> "%fdest%"
ECHO print 'processing file - %fname% ' >> "%fdest%"
TYPE "%fname%" >> "%fdest%"

ECHO. >> "%fdest%"

==========================================
Cursors are useful if you don't know sql.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -