How to create a primary key using SSIS?

I am working with SSIS and cannot figure out how to generate the primary key?

I have a very simple SSIS data stream:

Excel File Source -> Character Map -> ADO.NET Destination

The Excel file has the following structure:

Field1

The destination table has the following structure:

ID - UniqueIdentifier (GUID)
Field1

There is no problem displaying Field1, but how can I get the identifier to map to the NEWID () function of SQL Server (or something like the .NET method System.Guid.NewGuid ()).

+3
source share
1 answer

What you do is create a DEFAULT CONSTRAINT for the ID field as NEWID(). In SQL Server, go to the table design, click on the ID column and in the properties, find DEFAULT. Enter there NEWID(). Save the table.

SSIS 1, .

+3

Source: https://habr.com/ru/post/1721228/


All Articles