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

[Execute SQL Task] Error

$
0
0

Hi experts,


I am trying to get Columns Name from a select statement in MS SQL source. Something likes this:

declare @COLUMN_NAME varchar(max);

set @COLUMN_NAME=''

SELECT @COLUMN_NAME=@COLUMN_NAME+','+COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='XXX' and COLUMN_NAME not in ('TimeStamp')

select @COLUMN_NAME as ColsList

I use ExecuteSQLTask to get the result set with result name @COLUMN_NAME along with ADO.NET connection type.
And I got a task failed error which is described below:

[Execute SQL Task] Error: An error occurred while assigning a value to variable "strPkgInsertColNames": "Unable to find column  ColsList in the result set.".

Please help me to fix this error, thanks alot

Best Rgds,

Inder


Viewing all articles
Browse latest Browse all 24688

Trending Articles



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