SQL-Server, stored procedures, recordcount

Results 1 to 3 of 3

Thread: SQL-Server, stored procedures, recordcount

  1. #1
    Thomas Wrobel Guest

    Default SQL-Server, stored procedures, recordcount

    Hi,<BR><BR>I try to call two different stored procedures with a static cursor from<BR>sql-server. In one case, I get a recordcount, in the other, my recordcount<BR>= -1.<BR><BR>The one that workes looks like that:<BR>--------------------------------------------<BR>CREATE PROCEDURE login_userdata (@strID smallint, @strPassword varchar(30))<BR><BR>AS<BR><BR>select member_user.id, member_user.name, vorname, aktiv, ablauf , atag,<BR>alevel, email, lastonline, pseudos, female, first, logins,<BR>system_params.pvalue from member_user LEFT JOIN system_params ON<BR>member_user.pagersound = system_params.id where member_user.id= @strID and<BR>password= @strPassword<BR>------------------------------------------------<BR><BR>The other looks like that:<BR>----------------------------------------------------<BR>CREATE PROCEDURE member_online_list(@wlort varchar(3), @intListort integer)<BR>AS<BR><BR>IF @intListort = 1<BR> select online_cn.id as oid, online_cn.userid, online_cn.sessionid,<BR>online_cn.oltime, member_user.id,member_user.name, member_user.vorname from<BR>online_cn INNER JOIN member_user ON online_cn.userid = member_user.id<BR>WHERE online_cn.wlort = @wlort OR online_cn.wlort = "bw" ORDER BY vorname,<BR>name<BR>ELSE<BR> select online_cn.id as oid, online_cn.userid, online_cn.sessionid,<BR>online_cn.oltime, member_user.id,member_user.name, member_user.vorname from<BR>online_cn INNER JOIN member_user ON online_cn.userid =<BR>member_user.id ORDER BY vorname, name<BR>-------------------------------------------------<BR><BR><BR>can anyone help me?<BR><BR>Regards<BR>Thomas<BR><BR><BR><BR><BR>

  2. #2
    Sathiya Guest

    Default RE: SQL-Server, stored procedures, recordcount

    http://www.asp101.com/samples/db_count.asp<BR><BR>This article may help you

  3. #3
    Thomas Wrobel Guest

    Default RE: SQL-Server, stored procedures, recordcount

    Hi,<BR><BR>thanks for your reply. The problem does not seem to be specific to recordcount, but to the way you write stored procedures. With a plain select statement in a stored procedure I can get a recordcount, but when I use an If statement to choose between two different select-statements, I allways get a recordcount of -1. In both cases, the ASP-Code is identical.<BR><BR>Regards<BR>Thomas

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •