Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...If I'd only had resource like eng-tips when I was just getting started! I might have dazzled them with my brilliance instead of my BS..."

Geography

Where in the world do Tek-Tips members come from?
kgreer (MIS)
4 May 12 12:39
Here is my issue.

I have to produce a text File that looks like below:
PAT, 123456,SMITH,JOHN,,1200 Main St,,Houston,TX,77074,7138889999,01011960,123456789,M
CLM, 01012010,01022010,,Jon,Brown,David,Lasso,,1234567890,,SW Hospital,340 Main,,Houston,TX,77000,34500,32301,,
PROC, 01012010,01012010,99411,,,,21,1,12,1,20000
PROC, 01022010,01022010,99411,,,,21,1,12,1,20000
INS1, AET01,AETNA,1200 BLOOMINGDALE RD,,SEATTLE,OR,92892,SMITH,JOHN,,1200 Main St,,Houston,TX,77074,7139998888,01011960,123456789,M,01,390293,,TX INST


Each row is a table.

PAT is table PAT_TABLE
CLM is table CLM_TABLE
PROC is table PROC_TABLE -- The detail information, repeats
INS1 is table INS1_TABLE

I have queries that can return the data in each table, then I do a UNION on the tables to display them.  Because I am using a UNION, I have to make sure all the column match in each query.  The issue is I don't need the extra columns in the text file.

So I was wondering can this be done in a SSIS package?  Right now it is generating my Text File with all the extra columns.
jjefferson (TechnicalUser)
31 May 12 18:14
I think the only way you are going to get un-matched rows like this would be to have each query concatenate the values into one varchar(max) column, and union those.

So your PAT query would build a long string with whatever values and commas are needed as a single string, CLM would do the same, etc. Then you end up with essentially one column being reported from each query, which can be unioned.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close