Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

Inserting Data into two tables when there is reference between two tables

$
0
0

I have two tables

USE Ticket
GO
CREATE TABLE Test1
(
FirstName NVARCHAR(255),
MiddleName NVARCHAR(255),
LastName NVARCHAR(255),
ContactID INT
CONSTRAINT pk_Test1_pid PRIMARY KEY(ContactID)
)
GO
CREATE TABLE Test2
(
ContactID INT,
SalesOrderID INT,
TotalDue MONEY,
CONSTRAINT pk_Test2_sid PRIMARY KEY(SalesOrderID),
CONSTRAINT fk_Test2_sid FOREIGN KEY(ContactID) REFERENCES Test1(ContactID)
)

Trying to insert rows from a flat file

File is very big i am only giving the column headers for reference and there is one to many relationship between two tables

FirstName,MiddleName,LastName,ContactID,TotalDue

What should be the approach to insert data in to two tables using SSIS


Smash126



Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>