>If I have a header and line item table, and I want to insert a record into both,
>after the SQLEXEC command, how do I know the primary key of the header record to
>use in the detail record?
If you're refering to an IDENTITY column, check SCOPE_IDENTITY, and @@IDENTITY in BOL.
--sb--