Is there a way to return the equivalent of @@IDENTITY using a GUID?
I need to insert data into a database in a parent/child format.
I insert the parent information into the parent table like this
Then I need to insert the child information into the childs table something like thisCode:Parent Table PID (GUID) PK ParentName INSERT INTO tableName VALUES(newid(), '" & strParentName & "')
any ideas?Code:Child Table CID (GUID) PK PID (GUID) FK references ParentTable.PID ChildName INSERT INTO tableName VALUES(newid(), get GUID that was inserted in ParentTable.PID field, '" & childName & "')


Reply With Quote