sql server 2005 - SQL Select a row and store in a SQL variable -
so, i'm writing stored proc , suck @ sql.
my question guys is:
can select entire row , store in variable?
i know can like:
declare @someinteger int select @someinteger = (select someintfield sometable somecondition)   but can select entire row sometable , store in variable?
you can select fields multiple variables:
declare @a int, @b int  select   @a = col1,   @b = col2 sometable ...   another, potentially better, approach use table variable:
declare @t table (   int,   b int ) insert @t ( a, b ) select   col1,   col2 sometable ...   you can select table variable regular table.
Comments
Post a Comment