Answer by TimothyAWiseman
If you mean that you want to set the identity column on a particular insert to the same value for all 3 tables in this batch, then you have to first make sure that that value is available in all 3...
View ArticleAnswer by Kevin Feasel
It sounds like SCOPE_IDENTITY() is what you're looking for. After you do an insert into the table with the identity column, do something like the following: declare @NewRecordId int; select...
View ArticleAnswer by Jos Menhart
I would go with Kevin's answer as well, and create foreign keys when referencing other table's identity columns. I would like to add one thing: if I would do this I would insert using the OUTPUT clause...
View ArticleAnswer by TimothyAWiseman
If you mean that you want to set the identity column on a particular insert to the same value for all 3 tables in this batch, then you have to first make sure that that value is available in all 3...
View ArticleAnswer by Kevin Feasel
It sounds like SCOPE_IDENTITY() is what you're looking for. After you do an insert into the table with the identity column, do something like the following: declare @NewRecordId int; select...
View ArticleAnswer by Jos Menhart
I would go with Kevin's answer as well, and create foreign keys when referencing other table's identity columns. I would like to add one thing: if I would do this I would insert using the OUTPUT clause...
View Article
More Pages to Explore .....