Suppose I have two table. First table\'s primary key is the foreign key for another table.
Table Member has its primary key as the foreign key in
Member
I've seen "funny" behavior with scope_identity. As a result, I like to use an output clause. Here's an example:
declare @id table (i int) insert into Member (name) values ('NightKnight') output (MemberId) into @id select * from @id