Cos I need to pull an ID from the first insert and insert that ID into the second insert in a certain field. The two tables are related so I have to relate them somehow
-----Original Message----- From: Nick McClure [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 12:40 PM To: CF-Community Subject: RE: Two Inserts You should be able to do it like this: <cfquery> INSERT INTO foo (a,b) Values ('a','b') INSERT INTO bar (c,d) Values ('c','d') </cfquery> Any particular reason you want to do it this way? > -----Original Message----- > From: Phoeun Pha [mailto:[EMAIL PROTECTED]] > Sent: Monday, October 14, 2002 1:34 PM > To: CF-Community > Subject: RE: Two Inserts > > I using SQL Server. > > -----Original Message----- > From: Nick McClure [mailto:[EMAIL PROTECTED]] > Sent: Monday, October 14, 2002 12:04 PM > To: CF-Community > Subject: RE: Two Inserts > > > > Yes, just put one right after the other. > > Or you can also use a Stored Proc. What database are you using? > > > -----Original Message----- > > From: Phoeun Pha [mailto:[EMAIL PROTECTED]] > > Sent: Monday, October 14, 2002 12:58 PM > > To: CF-Community > > Subject: Two Inserts > > > > Is it possible to do 2 inserts in one SQL transaction? If so, how? > > > > :-D > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=5 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_community Get the mailserver that powers this list at http://www.coolfusion.com
