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

How to use script task to create a top row string (column headers) in a delimited text file output based on the columns exported?

$
0
0

How can I create customized column headers (different from the one in the database) in a text file using a script task based on the columns exported?  

For example, if I used the following SQL to select the columns

select id, name, address

And the column headers in the output should be

ID, Full_Name, Street_Address

I know you will need to write a conditional code to loop through the columns like

for each selected column

if column = "id" then "ID"

if column = "name" then "Full_Name" and so on

But how can I start (what task) and what will the correct code be? (Prefer VB, but C# is OK too.)


BI Analyst


Viewing all articles
Browse latest Browse all 24688

Trending Articles



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