1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[SQL] Direct stored procedure table-valued output to a table [duplicate]

Discussão em 'Outras Linguagens' iniciado por Stack, Outubro 7, 2024 às 11:32.

  1. Stack

    Stack Membro Participativo

    I have a stored procedure that (probably) has something like

    SELECT f1, f2, f3
    FROM someTable


    (more complex, but complexity is not relevant for the question).

    The table is not a table valued output parameter, it is just a statement.

    And, I don't have access to modify stored procedure to make a table valued type parameter.

    When I run it, I want to be able to direct that output into a temporary table.

    Something like you would do if writing a select yourself in this way

    SELECT f1, f2, f3
    INTO #TEMPTABLE
    FROM someTable


    My immediate guess is to do something like

    SELECT *
    FROM (EXEC sp_MyStoredProcedure)


    But, it is incorrect. Can I get what I am looking for without creating a table valued type ?

    Continue reading...

Compartilhe esta Página