Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2003
    Posts
    2

    Red face Unanswered: NOT returning a result set from a select statement

    Hello all,

    I am sure there is an obvious answer to this question and I am missing it.

    I have a stored procedure which ultimaly ends in a creat table, select ... for xml auto, elements and a drop table. All that works fine however I also do several selects mid procedure to get soome vars I need later. I have them outside (prior to) my begin and commit/rollback transaction statements.

    These selects are returning with the output but I want the surpressed and not returned at all. Am I missing some simple thought here to have those NOT display in the output?

    Thanks!

  2. #2
    Join Date
    Feb 2002
    Location
    Houston, TX
    Posts
    809
    any select statment that does not result in a table insert or value assignment to a variable will become part of the overall result set.

    maybe you could post your code, someone should be able to help.
    Paul Young
    (Knowledge is power! Get some!)

  3. #3
    Join Date
    Jan 2003
    Posts
    2

    Thanks

    Paul,

    Your response woke me up and I found the obvious mistake I had made. Was doing a rowcount and did select * then @@ROWCOUNT instead of @var=count(foo) and now it works perfect.

    Thanks again for the smack in the head.

    Originally posted by Paul Young
    any select statment that does not result in a table insert or value assignment to a variable will become part of the overall result set.

    maybe you could post your code, someone should be able to help.

  4. #4
    Join Date
    Feb 2002
    Location
    Houston, TX
    Posts
    809
    always up for a good bashing! Glad to help!
    Paul Young
    (Knowledge is power! Get some!)

Posting Permissions

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