Sql-server – Facing Error in “Execute Sql task” component (The type of the value (DBNull) being assigned to variable)

sql serverssisvisual studio

Hope you are doing well
I have a table as you can see below :

enter image description here

I have a variable "ExcelPath" in "SSIS" in which I keep "FilePath" column .

Then I have "Execute SQL task" and the query I wrote in this task as you can see below
enter image description here

If you compare the sql query with the table you find out that I need to retrieve "DestinationTable" column where the "Filepath" column is equal to what is in my variable "ExcelPath"

the parameter mapping tab is configured like this :
enter image description here

and the result set tab shows I want the output into another variable called "TableName"
enter image description here

I think everything is fine , I have no idea why I'm getting this error :
"The type of the value (DBNull) being assigned to variable "User::TableName" differs from the current variable type (String)"

I was wondering if you could help me up with this issue.
Thanks in advance

Best Answer

Problem Solved . See, I wanted to retrieve only one column on my table so I set the result set of the general tab to "single row" as you can see here : enter image description here

as you can see here

enter image description here

And in result set tab , I configured the resultName to my column name