I need to create a stored procedure that would create a pipe delimited text file based on user requirements.
The table that I will use has only 6 columns with names different from user required fields.
Also, the number of columns that user wants is 23. Some of them we do not have data for. I just need to display them in the text file.
I'm not sure how to display the data lined up under appropriate column while skipping other optional columns.
I think I would need something like this:
OptionalColumn 1|DataColumn 1|OptionalColumn 2|DataColumn 2
                  12/12/2015                      Name 1
                  12/12/2015                      Name 2  
Or some other formatting for pipe delimited file.
How would I approach this? Never done something like this.
 
     
     
     
    