|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
How to submit to a table in two different db's
I am working with two db's (i.e John and John1) I have a form that when submitted the information goes to the (i.e) Doe table. This table (Doe) is located in both the John db and John1 db, I need to add the functionality so that when the submit button is selected both db's are updated. Plese help.
|
|
#2
|
||||
|
||||
|
Assuming you can do the update for one table, simply duplicate that command for the other table. So in your form handler page, you would have a connection to the 'John' and execute your query, then close that connection, and do the exact same thing again, only changing 'John' to 'John1'.
If you don't know what to do at all, I can point you to some tutorials online. |
|
#3
|
|||
|
|||
|
Depends....
I'd recommend looking at transactional replication if they're complete copy tables. If it's just duplicates from this form, A) why? that sounds like redundant data and you could split it up to be the same table or work with referential keys and B) look into using triggers if you can in this situation, triggers will automatically update another table when some action occurs. |
|
#4
|
|||
|
|||
|
karsh44, tutorial would be great. I was thinking I would need two Data Connections. Also, I suggest using triggers but I was told to do it on the web application. So, I must do my job as told.
Karsha44 please forward that tutorial info ASAP. Thanks very much! |
|
#5
|
||||
|
||||
|
http://www.planet-source-code.com/v...&txtCodeId=6442
is all about connecting to database and running sql queries. http://www.ultimateapps.com/support/kbarticle.asp?ID=2 has more info about connection strings if you need it. A couple good asp sites in general: www.asp101.com www.aspfree.com www.4guysfromrolla.com HTH |
|
#6
|
|||
|
|||
|
who told you to do it all through the web application out of curiosity? Only because there are many very good reasons not to do it that way. THE only reason to do it that way is convenience, but i guess you should ask how important is the validity/integrity of these two databases? Probably not very high and i always go too far anyways *shrug*
Last edited by unatratnag : September 8th, 2003 at 10:36 PM. |
|
#7
|
|||
|
|||
|
My Team Lead told me this. I thought it would be better to do on the db side. We have DTS set up now to do this, but the DTS is set to update dB 2 every morning. They want to update the db in real time.
Last edited by mccray_26 : September 8th, 2003 at 10:52 PM. |
|
#8
|
|||
|
|||
|
In realtime? no problem. A trigger can absolutely do it.
Data consistency, delay for processing the request need to be considered for a web page. I think they can be very well avoided with a trigger doing the second db update. You have the transaction handling that you can use to roll back the changes from within your application, if the trigger fails. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > How to submit to a table in two different db's |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|