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
 General SQL Server Forums
 New to SQL Server Programming
 Creating multiple stored procedures at once

Author  Topic 

Quish
Starting Member

8 Posts

Posted - 2008-05-01 : 10:09:09
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 Analyzer 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

RyanRandall
Master Smack Fu Yak Hacker

1074 Posts

Posted - 2008-05-01 : 10:35:34
You probably need a 'go' between each stored procedure...

create proc p1 as
select 1
go

create proc p2 as
select 2


Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
Go to Top of Page

Quish
Starting Member

8 Posts

Posted - 2008-05-01 : 11:03:05
yes thats it - Thank you - its always the simplest things that course the biggest bother.
Go to Top of Page
   

- Advertisement -