0

I have an Execute SQL task with an OLE DB source that is running this query:

SELECT OBJECT_ID('AppLogin') AS TableID

In the Result Set tab, I have Result Name 0 mapped to Variable Name User::TableID.

The task executes, but the variable never gets set. It remains 0.

3 Answers 3

2

In the Result set Tab, Set the ResultName = TableID

Ensure that you verify this query "SELECT OBJECT_ID('AppLogin') AS TableID" by clicking Build Query Button from General Tab in the Execute Sql Task Editor. It should return the expected value for AppLogin Object.

Sign up to request clarification or add additional context in comments.

3 Comments

Running from the query builder returns the table id as expected.
Have you set the ResultName to TableID in the result set tab? This should solve your problem as you were setting Result Name to 0 earlier.
Yes, I did try that. But it turned out to be something very different. Please see my answer.
0

In the general settings of your Execute SQL task component. Make sure the Result Set is set to "Single Row".

1 Comment

Result Set is set to "Single Row"
0

The problem turned out to be the constraints. I had an expression and a constraint going into the Update component.Needed the OR on constraints

Didn't realize that the flow wasn't sequential and that the expression and a constraint still need to be OR'ed.

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.