0

Say I want to get the key values of two tables and assign to two package variables.

I can easily assign one, setting the Execute SQL Task to return a single row. But is it possible to set multiple variables with multiple result sets?

I have this SQL:

SELECT COALESCE(MAX(LogKey),0) AS LogKey FROM Log
SELECT COALESCE(MAX(HeaderKey),0) AS HKey FROM Header

I've tried setting the ResultSet property to both single row and Full result set, but neither seem to work. Do I have to use a separate Execute SQL task?

1 Answer 1

3

You could try this to force the values on the same resultset:

SELECT
A = (SELECT COALESCE(MAX(LogKey),0) AS LogKey FROM Log),
B = (SELECT COALESCE(MAX(HeaderKey),0) AS HrKey FROM Header)
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.