This is a discussion on Insert SP results into variable? within the SQL Server forums, part of the Microsoft SQL Server category; --> Is it possible to take the result from an SP that returns 1 value and insert it into a ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| <jw56578@gmail.com> wrote in message news:1111709552.442972.201630@l41g2000cwc.googlegr oups.com... > Is it possible to take the result from an SP that returns 1 value and > insert it into a variable? > If a procedure returns one value, then you should use an output variable: create proc dbo.p_out @i int output as set @i = 1 go declare @num int exec dbo.p_out @i = @num output select @num This is usually the best approach for procedures which return only one row of data: http://www.sommarskog.se/share_data.html#OUTPUT Simon |