jay
jay

Reputation: 3889

mapping result in sql server

I have an Exec SQL Task that runs a simple select statement but is it possible to capture the result value and to map the resulting value to a variable?...i've tried but have not been successful [Sad]

Upvotes: 1

Views: 67

Answers (2)

DForck42
DForck42

Reputation: 20367

this does not work if the select statement returns more than one value

declare @ a int

select @a= Column1 from Table_A

Upvotes: 0

Flakron Bytyqi
Flakron Bytyqi

Reputation: 3254

DECLARE @var INT
SET @var = (SELECT age FROM some_table WHERE id = 2)

Upvotes: 1

Related Questions