Results 1 to 2 of 2

Thread: Executing a stored function from a query

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Posts
    3

    Red face

    Anyone know if you can execute a stored procedure within another stored procedure / query??

    Trying to do this

    SELECT .........

    WHERE (COMPANY_ID NOT IN (SELECT..........)

    I want the NOT IN Query to be stored as a seperate procedure/query

    I can do it in access I know but I need to do it in Transact-SQL

  2. #2
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    I think it would be like this:

    SELECT .........

    WHERE (COMPANY_ID NOT IN (execute sp_whatever))


    don't have my SQL Server up right now or I'd double check it....
    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

Posting Permissions

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



Click Here to Expand Forum to Full Width