|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Update accross related tables
For simplicities sake, I have two tables. Each are related by a column IssueID, column is autoincremented in Table1, but not so in Table two as it can contain multiple rows of data related to Table1. I'm building a web application that will insert data, but am not sure how to either update both tables with the same data form, or how to get (reliably) the IssueID of the query submitted by the form. any help appreciated.
|
|
#2
|
||||
|
||||
|
i'm not sure what you mean by updating both tables with the dataform. as long as you have the IssueID you'll be set.
are you trying to get the number of the newly created autonumber from the main insert? if so you can use a stored proc to do the insert. Any time you insert into a auto table you can use the @@IDENTITY var --test being the table with the autonum primary key insert into test values ('hello') select @@IDENTITY hope this helps. Al |
|
#3
|
||||
|
||||
|
or an update trigger on the main table...
|
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > Update accross related tables |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|