Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server ASP
|
SQL Server ASP Discussions about ASP programming with Microsoft's SQL Server. For more ASP forums, see the ASP forum category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server ASP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 11th, 2003, 04:19 PM
Registered User
 
Join Date: Sep 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Inserting information into different dB's tables.

I have a form that is insert information into my Summary table in a db call Jobs. But, I want the form to insert information into my Summary table in db:Job and my Summary table in db:Workers. So, I need an example on how to insert information into two tables on different db's. Please help.

 
Old September 11th, 2003, 06:47 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

First, please clarify something -- do you mean insert into two different databases or two different tables in the same db?

I'll assume you mean two tables in the SAME database.You'll need to perform two different INSERT queries. You can only insert into one table at a time. If you need to perform multiple INSERT queries, use a transaction.

For SQL Server, you might as well just write a stored procedure that contains the transaction and pass the procedure your incoming data as parameters.


Take care,

Nik
http://www.bigaction.org/





Similar Threads
Thread Thread Starter Forum Replies Last Post
Inserting values from other tables TheAndruu SQL Language 7 May 27th, 2007 10:47 AM
Inserting data into 2 tables chrscote Access ASP 1 August 1st, 2005 09:01 AM
inserting into multiple tables cridley SQL Server 2000 1 January 25th, 2005 12:05 PM
Inserting Information From Form into another Table smartgir Access VBA 6 October 22nd, 2004 12:35 AM
inserting into joined tables cjennings SQL Server 2000 3 July 23rd, 2003 06:10 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.