SSIS: A workaround for variable query statements that cause column output to be in an inconsistent order

Source: Internet
Author: User
Tags ssis

The problem comes from the Yu Tianxian bi community, which is interesting to see because I myself think there is more experience in SSIS dealing with various types of files (almost all ETL is related to files for a year), but this question has not been specifically considered before. Studied a bit, found a solution, hurriedly recorded.

A brief description of this problem, if our SOURCE is directly from the table query, and then output to the file, the order of the columns in the query statement is the order of the output file columns (comma-delimited file). But if you use variable query statements, then the order of output and query columns will be inconsistent! If our file format has been defined in advance, then this will be very difficult to adjust. Unless you manually delete all the columns in the File Manager, and then re-establish them, it can be time-consuming and exhausting, and very error-prone.

Take a look at the problem first, and then look at the more simple solution.

Test the Data source query statements and results-

If you are querying directly, the order of the output columns of the file does not have any problems or effects, and the following are my query statements, as in SQL Server.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.