Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

Assigning SQL value to variable

$
0
0

Hi,

I have an Execute SQL task for which output is a SQL statement - 'Create Table tablename ....'. So I want to store this SQL statement to a variable(User::Table_Script). Then I want to execute it so I have another Execute SQL Task where SQL statement is '?' and the parameter Table_Script is mapped here.

Initially I used datatype for this variable as String but it gave me following error - The type of the value (Empty) being assigned to variable "User::Table_Script" differs from the current variable type (String)

So by reading online I changed the datatype to Object, which works for the 1st Execute SQL task. But now the 2nd Execute SQL Task gives me the following error - Executing the query "?" failed with the following error: "The name '' is not a valid identifier.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

What needs to be done here?


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>