Print Page | Close Window

Merging 2 databases... tblAuthor

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Database Discussion
Forum Description: Discussion and chat on database related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=4840
Printed Date: 30 March 2026 at 3:54am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Merging 2 databases... tblAuthor
Posted By: Joeee
Subject: Merging 2 databases... tblAuthor
Date Posted: 07 August 2003 at 12:52pm

Hi everyone,

I'm trying to figure out the best way to merge Web Wiz Forums into my existing auction application. The skins work great... however, I don't want to make my users register twice. What's the best (and easiest) way to merge my 2 "user" tables? I'm currently considering the easy way out... adding insert/update triggers to each table. Is there a better way? Anyone have experience with this? Are there any add-ons that could help with this?

Thanks




Replies:
Posted By: ljamal
Date Posted: 07 August 2003 at 3:45pm
What I did was:
remove the identity from the Author_ID field
delete the duplicate fields in tlbAuthor
change the name of the table to tlbAuthorA
created a view joining the deleted fields from my member table with tblAuthorA (the newly joined fields should have the same name as the tblAuthor fields that were deleted)
I changed the default values in tblAuthorA so that new members are automatically added to my default group and so that all field that did not accept null had a default value.
insert the new Author_ID for each new Member added to you member's table.

There were other changes, but this should get you on your way

-------------
L. Jamal Walton

http://www.ljamal.com/" rel="nofollow - L. Jamal Inc : Web/ Print Design and ASP Programming


Posted By: Joeee
Date Posted: 07 August 2003 at 3:53pm
Nice! That sounds like a much more elegant solution than the trigger idea. Thanks! Did you have to do a lot of work on the ASP side of things, or was this a 100% database solution?


Posted By: ljamal
Date Posted: 07 August 2003 at 3:59pm
Most of the changes are pure database changes.

There are a few ASP changes, but mostly on the register.asp as it is used for updates to the tblAuthor table. You can not update a view, so you will have to alter it a bit.

-------------
L. Jamal Walton

http://www.ljamal.com/" rel="nofollow - L. Jamal Inc : Web/ Print Design and ASP Programming


Posted By: Joeee
Date Posted: 07 August 2003 at 7:08pm
Thanks! The view worked perfectly, but I'm having trouble understanding the register.asp. I've never seen ASP database calls like .Update and .Fields ??? I did a keyword search and can't even find the insert statement or reference to tblAuthor!? It doesn't look like it's calling a stored procedure to do the insert, so I'm kind of lost. Help?


Posted By: ljamal
Date Posted: 07 August 2003 at 7:15pm
The .Update is updating the recordset defined by the SQL statement. It updates the fields from the .Fields. If you change the SQL statement to call the tblAuthorA table and remove the updates to the fields that no longer exist in the table then that should work.

-------------
L. Jamal Walton

http://www.ljamal.com/" rel="nofollow - L. Jamal Inc : Web/ Print Design and ASP Programming


Posted By: Joeee
Date Posted: 08 August 2003 at 11:29am

OK. This is driving me crazy. You're right on with the multiple updates problem, but now I've changed every single reference to the tblAuthor table (in register.asp) to tblAuthorB and I'm still getting this error!

SELECT tblAuthorB.Username FROM tblAuthorB WHERE tblAuthorB.Username = '4444';

Microsoft OLE DB Provider for SQL Server error '80004005'

Cannot insert or update columns from multiple tables.

/discuss/forum/register.asp, line 821



Posted By: ljamal
Date Posted: 08 August 2003 at 11:46am
That error is caused because it is trying to update the view. I'm assuming that you will not be using this page from registration, so just comment out the .Update and write and execute your own update.


-------------
L. Jamal Walton

http://www.ljamal.com/" rel="nofollow - L. Jamal Inc : Web/ Print Design and ASP Programming



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net