Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2005
    Posts
    6

    Lightbulb Unanswered: Can a stored procedure be executed from within a select statement?

    Can a stored procedure be executed from within a select statement?

    Given a store procedure named: sp_proc

    I wish to do something like this:

    Code:
    For each row in the table
      execute sp_proc 'parameter1', parameter2'...
    end for
    ...but within a select statement. I know you can do this with stored functions, just not sure what the syntax is for a stored procedure.

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    No, not within a select statment. Well, maybe with OPENQUERY, but even if that did work I would never use it.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  3. #3
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    So convert it into a function...

    Is there a question here?
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

Posting Permissions

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