Quantcast
Channel: Answers for "Insert issue"
Browsing all 6 articles
Browse latest View live

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 Article



Answer 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 Article

Answer 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

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 Article

Answer 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 Article


Answer 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
Browsing all 6 articles
Browse latest View live




Latest Images