Set a SP return value to a variable in SQL Server

前端 未结 3 1991
长发绾君心
长发绾君心 2021-02-05 15:45

I have a sproc that returns a single line and column with a text, I need to set this text to a variable, something like:

declare @bla varchar(100)
select @bla =          


        
3条回答
  •  孤独总比滥情好
    2021-02-05 16:18

    DECLARE
      @out INT
    
    EXEC @out = sp_name 'param', 2, ...
    

    More info in T-SQL "EXECUTE" help (Help is from MSSQL 2008 but this works in 2000 too)

提交回复
热议问题