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

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 August 22nd, 2005, 05:58 PM
Sonicdynamite Sonicdynamite is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 19 Sonicdynamite User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 h 11 m 26 sec
Reputation Power: 0
Cool Replicating data between databases

All of my databases reside on one Instance of SQL Server 2000.

I have seven distinct databases at my place of employment. Examples include a database for financial employees, sales employees, a database for our online employee incentive store, HR, etc...

The one thing each of these individual databases have in common is a "users" table that contains basic information about the user (address, state, zip, job title, etc). It also contains their login name and password.

I would like to set up the server so that when a user changes their information in one system (ex. financial), the SQL server updates the users record in every other database.

Just out of curiosity, I want to keep all of these databases clearly separated from one another, but it seems to be counterproductive to have a users table containing nearly the same info in each database (there are a few specific fields that differ from one database to another)...

Is there a better way to do this that I haven't thought of? Any help is much appreciated.

Reply With Quote
  #2  
Old August 22nd, 2005, 08:12 PM
kcconnor's Avatar
kcconnor kcconnor is offline
Evil Republican...
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Location: Probably running over your cat right now...
Posts: 250 kcconnor User rank is Sergeant Major (2000 - 5000 Reputation Level)kcconnor User rank is Sergeant Major (2000 - 5000 Reputation Level)kcconnor User rank is Sergeant Major (2000 - 5000 Reputation Level)kcconnor User rank is Sergeant Major (2000 - 5000 Reputation Level)kcconnor User rank is Sergeant Major (2000 - 5000 Reputation Level)kcconnor User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 2 Days 21 h 35 m 23 sec
Reputation Power: 37
Quote:
Originally Posted by Sonicdynamite
The one thing each of these individual databases have in common is a "users" table that contains basic information about the user (address, state, zip, job title, etc). It also contains their login name and password.

I would like to set up the server so that when a user changes their information in one system (ex. financial), the SQL server updates the users record in every other database.

Just out of curiosity, I want to keep all of these databases clearly separated from one another, but it seems to be counterproductive to have a users table containing nearly the same info in each database (there are a few specific fields that differ from one database to another)...


You know, I hate it when someone comes along and suggests something that you explicitly said you don't want to do in your original posting. That said...

Why don't you bring all of your tables from each database into one master database? You can bring in the common attributes for your users such as login name, mailing address and password, but retain specifics for each "system" they interface with by just increasing the number of columns in the table. In my experience, ANYTHING you can do to reduce redundant user information, logins and passwords, should be done. Not only is it annoying, it's also a security risk.

That being said, if you don't want to conjoin all your little databases into one central database, you might try to create yet another database and store only your user information in there. Although at this point it really feels like we are treating a "database" more like a table...

You could reference it like this:

Code:
USE [db name for hr]
select fname, lname, salary, contract_date from CompensationTable INNER JOIN [db name for users].dbo.user on [dbo name for users].dbo.user.userid = CompensationTable.userid where userid = '1'


Or, you could extend your existing table definitions to hold a datetime field for each record that would trigger on each insert or update. At the end of the night you could write a monstrous DTS package that would go thru and compare your user tables in each database and overwrite data of all "lesser" dates with the values of the "greater" date. Yuck.

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft SQL Server > Replicating data between databases


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 4 hosted by Hostway
Stay green...Green IT