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
 Stored Procedure

Author  Topic 

dolphin123
Yak Posting Veteran

84 Posts

Posted - 2013-04-14 : 22:26:25
Hi,

I am getting this error

Msg 102, Level 15, State 1, Line 1
Incorrect syntax near ','.

where I run the SP:


exec DBNAME.dbo.SP_01 23,138


The SP is:


CREATE PROCEDURE [dbo].[SP_01]
(
@FirmID int
,@PeriodID int
,@Debug tinyint = 0
,@BatchSize int = 100000
)
AS
BEGIN


What I might be doing wrong:

I tried:

exec DBNAME.dbo.SP_01 23,138
exec DBNAME.dbo.SP_01 (23,138)
exec DBNAME.dbo.SP_01 @FirmID=23, @PeriodID=138

I am not sure why it is failing..

Can someone spot an issue?

Thanks



bandi
Master Smack Fu Yak Hacker

2242 Posts

Posted - 2013-04-15 : 00:04:58
there is no problem with the above code.. Post us what you are trying to do with this procedure?
CREATE PROCEDURE [dbo].[SP_01]
(
@FirmID int
,@PeriodID int
,@Debug tinyint = 0
,@BatchSize int = 100000
)
AS
BEGIN
SELECT @FirmID Firm , @PeriodID Period, @Debug debug, @BatchSize batch
END
GO
EXEC [dbo].[SP_01] 23, 40
GO
/*Output:
Firm Period debug batch
----------- ----------- ----- -----------
23 40 0 100000
*/
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-04-15 : 02:18:45
the error might be inside body of procedure which you've not posted here. post the ful procedure code

also the () around parameters is not required for procedures

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -