470,596 Members | 1,555 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,596 developers. It's quick & easy.

Stored Procedure Help

Hi,

I have written the below stored procedure but whenever i try to execute it it comes up with the error:

Msg 170, Level 15, State 1, Procedure PAGE_COUNT, Line 10
Line 10: Incorrect syntax near ')'.


Stored Procedure is as follows:

CREATE PROCEDURE PAGE_COUNT
@BNAME NVARCHAR(50)
AS
BEGIN
----QUERY FOR THE TOTAL COUNT WITHOUT SEPARATOR
DECLARE @PAGECOUNT INT
SET @PAGECOUNT = (SELECT COUNT(IMGTABLE.BATCHID) FROM IMGTABLE WHERE (BATCHID = @BNAME))
----QUERY FOR THE SEPARATOR COUNT
DECLARE @SEPARATORCOUNT INT
SET @SEPARATORCOUNT = (SELECT COUNT(BARCODETABLE.BATCHID) FROM BARCODETABLE WHERE (BATCHID = @BNAME))
Jun 28 '07 #1
3 808
srinit
43
Hi,

I have written the below stored procedure but whenever i try to execute it it comes up with the error:

Msg 170, Level 15, State 1, Procedure PAGE_COUNT, Line 10
Line 10: Incorrect syntax near ')'.


Stored Procedure is as follows:

CREATE PROCEDURE PAGE_COUNT
@BNAME NVARCHAR(50)
AS
BEGIN
----QUERY FOR THE TOTAL COUNT WITHOUT SEPARATOR
DECLARE @PAGECOUNT INT
SET @PAGECOUNT = (SELECT COUNT(IMGTABLE.BATCHID) FROM IMGTABLE WHERE (BATCHID = @BNAME))
----QUERY FOR THE SEPARATOR COUNT
DECLARE @SEPARATORCOUNT INT
SET @SEPARATORCOUNT = (SELECT COUNT(BARCODETABLE.BATCHID) FROM BARCODETABLE WHERE (BATCHID = @BNAME))



Hi
Error is at select statement
Try like this
[code]
SELECT @PAGECOUNT =COUNT(IMGTABLE.BATCHID) FROM IMGTABLE WHERE (BATCHID = @BNAME))
Jun 28 '07 #2
boss try this
CREATE PROCEDURE PAGE_COUNT

@BNAME NVARCHAR(50)
as
BEGIN
----QUERY FOR THE TOTAL COUNT WITHOUT SEPARATOR
DECLARE @PAGECOUNT INT
SET @PAGECOUNT = ( select COUNT(IMGTABLE.BATCHID) FROM IMGTABLE WHERE (BATCHID = 1))
----QUERY FOR THE SEPARATOR COUNT
DECLARE @SEPARATORCOUNT INT
SET @SEPARATORCOUNT=( select COUNT(BARCODETABLE.BATCHID) FROM BARCODETABLE WHERE (BATCHID = @BNAME))
end
Jun 28 '07 #3
thanks for the help.

It worked.
Jun 28 '07 #4

Post your reply

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

Similar topics

4 posts views Thread by Michael Trosen | last post: by
3 posts views Thread by Jarrod Morrison | last post: by
7 posts views Thread by Douglas Buchanan | last post: by
5 posts views Thread by microsoft.private.windows.netserver.setup | last post: by
7 posts views Thread by eholz1 | last post: by
reply views Thread by SOI_0152 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.