DTS return table ID
Hi All
I have the task of taking a long ASCII string in a flat file and importing it to SQL server.
I have to insert into several tables, but all tables but 1 require the table ID column of the "main" table, if you will. Example:
CREATE TABLE T_MAIN
(
T_ID BIGINT IDENTITY(1,1),
T_DATA1 VARCHAR(50)
)
CREATE TABLE T_SATELLITE
(
TSAT_ID BIGINT IDENTITY(1,1),
T_ID BIGINT NOT NULL,
TSAT_DATA1 VARCHAR(70)
)
T_MAIN.T_ID has a one-to-many relationship with T_SATELLITE.T_ID.
When I do the insert into T_MAIN, I want to get the value that was automatically put into T_ID and use it in my T_SATELLITE data import task.
Any help offered is very much appreciated!
Thanks!
"A spirit with a vision is a dream with a mission"
__________________
\"A spirit with a vision is a dream with a mission\"
|