How to insert the same guid in SSIS import

2019-08-28 01:22发布

问题:

I am inserting data from csv flat file to sql table using ssis package. I added a new column to the destination table called GUID. I need to insert the same guid for all rows every time the package runs. The problem is that it generates new guid for every row.

回答1:

You need an extra step in the package to generate the RunID (execute SQL and get the result into a variable), then, when you're inserting data (however you're doing it), pass the RunID variable into the query as a parameter that is selected as the value for the GUID column.