By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,377 Members | 1,388 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,377 IT Pros & Developers. It's quick & easy.

Creating multiple stored procedures at once

P: 22
Hey

I am creating a database application that is accessed through a .NET front end.
What I want to do is run a SQL script that will create my DB, create my indexes and enforce my constraints (all of which I have done) but I also want to create my stored procedures in the same script also.

When I merge all my stored procedures (about 16) into one file and run it in SQL Query Analyser I get multiple errors but the one that is coursing me the most bother is

‘Server: Msg 156, Level 15, State 1, Procedure procedureName, Line 134
Incorrect syntax near the keyword 'procedure'.’

What does this mean and why can’t I run more than once Stored Procedure at once?


Many thanks

Quish
May 1 '08 #1
Share this Question
Share on Google+
1 Reply


P: 22
I got the answer -

i needed a 'go' between each stored procedure

create proc p1 as
select 1
go

create proc p2 as
select 2

Many Thanks

Quish
May 1 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.