SQL Query Output to Variables

Hey guys I’m using the ‘Execute Query’ activity to pull out a set of data from SQL, how do I then assign those values to variables?

Example Query:
“SELECT TOP 1 [FirstName], [LastName], [DOB], [CurrentStatus] FROM dbo.MyDBO”

So I want to assign the first name value, last name value, date of birth value, and current status that the query pulls out and place those into corresponding string and int variables.

Hi @css

Execute Query activity will return you a Datatable

Below you can see the screen

Place a For each row as per the image, assign a variable and give the row number as below image


Eg: row(Index of the column).Tostring
OR row(“FirstName”).Tostring

How this helps



This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.