Write out the basic DDL please.
Are you using Guid's for the primary key? Or using IDENTITY's?
Dept
_____
DeptUUID , DeptName
Emp
_____
EmpUUID , EmpName , EmpDeptUUID
Are you creating a Dept, and then trying to create an Emp, but you need the
DeptUUID for the (fk) EmpDeptUUID ?
Something like that?
"GotDotNet?" <cs*********@optonline.netwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
that won't work becaue the identity column is not the id field I need. I'm
generating a GUID that I need to all the tables for an ID field.
"mac" <kb********@gmail.comwrote in message
news:11********************@q75g2000hsh.googlegrou ps.com...
On May 1, 4:09 pm, "GotDotNet?" <csharpco...@optonline.netwrote:
Is there a way to insert data into 2 tables but use the ID from table 1
and
insert that into table 2 as well as several other values?
so I can insert a ID into table1, I then need that ID and insert that
with
the records into table2.
I'm not using a a stored procedure, I'm using inline sql statements.
should I do the insert first then do a select on table1 and use that
parameter or is there another way to do this?
SELECT scope_identity()
after your INSERT statement into the first table.