SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old November 11th, 2000, 03:29 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
How can update and add to multiple tables?

<i><b>Originally posted by : Richard (rsweeting@bahamas.net.bs)</b></i><br />How can i update a table and at the same time add to another table.<br /><br />I used the code from this site:<br />http://www.aspfree.com/asp/startpage.asp?id=23<br /><br />This works well for me BUT i need to know how i can do this:<br /><br />when the data is sent to update the table how can i code it to also ADD this data to a table.<br /><br />There are 15 records that are updated, i need these 15 records to be ADDED to another table everytime the form is submitted.

Reply With Quote
  #2  
Old November 13th, 2000, 03:11 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
<i><b>Originally posted by : Bill Bozeman (bill_bozeman@hotmail.com)</b></i><br />In order to update 2 tables at the same time, you need to do one of two things. You can just have<br />2 SQL calls, one that updates one table, and then one that updates the other table. That works <br />well if you only need to do this on this page, but you have other pages where you want to add <br />data to the first table but not the second. If you always want to add data to the second table when<br />added to the first table, then I would use a trigger (if the db supports this) and after you update your<br />first the trigger will fire and update the second.<br /><br />However, a bigger question might be the design of your database. There is rarely a need to double <br />up on the data and you shouldn't be adding the same data twice to two different tables. That is why<br />there is not inherant command in SQL to do this, because it does not follow the rules of normalization.<br /><br />Bill<br /><br /><br />------------<br />Richard at 11/11/2000 1:29:17 PM<br /><br />How can i update a table and at the same time add to another table.<br /><br />I used the code from this site:<br />http://www.aspfree.com/asp/startpage.asp?id=23<br /><br />This works well for me BUT i need to know how i can do this:<br /><br />when the data is sent to update the table how can i code it to also ADD this data to a table.<br /><br />There are 15 records that are updated, i need these 15 records to be ADDED to another table everytime the form is submitted.

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > How can update and add to multiple tables?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway