Home Forums SQL Server 7,2000 T-SQL Return a Table from a Stored Procedure RE: Return a Table from a Stored Procedure

  • Hi,

    you could use both table variables and temporary tables. In terms of scope both of them will be restricted to your stored procedures. Both have advantages and disadvantages. Basically if you have very large tables, use temptables.

    very simple examples for thes:

    declare @table table(a int, b int)

    insert into @table values (1,2)

    select * from @table

    create table #table (a int, b int)

    insert into #table values (1,2)

    select * from #table

    Regards,

    Andras


    Andras Belokosztolszki, MCPD, PhD
    GoldenGate Software