S
Savas Ates
I have a stored procedure below.. When I run it with a well parameter in
query analyser 3 of select statements return me. (i named select statements
1,2,3)
But in asp page when i call this procedure same as query analyser it returns
me 2 select statements value? what is the problem ?
CREATE PROCEDURE ST_25INDIRIM
@sesid BIGINT
AS
IF EXISTS (SELECT 1 FROM sepet WHERE (adet=2 AND sesid=@sesid ) )
BEGIN
-1- SELECT * FROM sepet WHERE (adet=2 AND sesid=@sesid)
END
ELSE
/*URUN SAYISI IKI TANE OLAN YOK VE ADETI BIR TANE OLAN EN AZ 2 URUN OLUP
OLMADIGI KONTROLU*/
BEGIN
-2- SELECT * FROM sepet WHERE (adet =1 AND sesid=@sesid) ORDER BY id ASC
IF (@@rowcount>=2 )
BEGIN
-3- SELECT TOP 1 * FROM sepet WHERE id IN (SELECT TOP 2 id FROM sepet
WHERE (adet =1 AND sesid=@sesid) ORDER BY id ASC ) ORDER BY id DESC
END
END
GO
query analyser 3 of select statements return me. (i named select statements
1,2,3)
But in asp page when i call this procedure same as query analyser it returns
me 2 select statements value? what is the problem ?
CREATE PROCEDURE ST_25INDIRIM
@sesid BIGINT
AS
IF EXISTS (SELECT 1 FROM sepet WHERE (adet=2 AND sesid=@sesid ) )
BEGIN
-1- SELECT * FROM sepet WHERE (adet=2 AND sesid=@sesid)
END
ELSE
/*URUN SAYISI IKI TANE OLAN YOK VE ADETI BIR TANE OLAN EN AZ 2 URUN OLUP
OLMADIGI KONTROLU*/
BEGIN
-2- SELECT * FROM sepet WHERE (adet =1 AND sesid=@sesid) ORDER BY id ASC
IF (@@rowcount>=2 )
BEGIN
-3- SELECT TOP 1 * FROM sepet WHERE id IN (SELECT TOP 2 id FROM sepet
WHERE (adet =1 AND sesid=@sesid) ORDER BY id ASC ) ORDER BY id DESC
END
END
GO