largo68
largo68

Reputation: 629

SSIS 2008 sql task returning a variable

I have a problem when trying to retrieve a value from a sql task and pass it to an integer variable. I configure the sql task with resultSet in a single row and Result Name = "0" , Variable Name ="Myvar" Here is the code I use in the sql statement:

select max(runid) from table 

with this query, using the max function, my variable get always the default value. However when using the code:

select runid from table 

, my variable get the correct data. Can you see what wrong is?

Thanks a lot

Upvotes: 2

Views: 314

Answers (1)

Derek
Derek

Reputation: 23228

Try adding an alias?

select max(runid) as runid from table

Upvotes: 4

Related Questions