Foreign Key across Databases?

  • Please have a look our new third party tool for SQL Server : http://www.remote-keys.com

    RemoteKeys allows you to create foreign keys across SQL Server databases

    Tom

  • Lucky for you, Sergiy, you have less than 1GB of a problem in that situation. In my case, we have over 50 SQL Servers, with data spread in 10 dbases each and data tables being replicated every where.

    The thing is, I'm less than a year in this company. And when I ask the senior ones on the origin of a replicated table, they'd have to look for it themselves before they can tell you a not so definite answer.


    Ronald San Juan | SQL DBA
    ID 710124 ~ Code "Northwind"

  • Hoo boy... here we go... actually, Eric is absolutely right... there is a time when you would want to have foreign keys to another database.  Here's an example as to why...

    We made a call accounting program using SQL Server as the back end.  Yeah, we followed all the best practices of using CRUD and keys and the like.  We also had about 10 gig of nearly static data that only changed once a month and, since we always kept a copy of the raw source data, we never had to back this stuff up except once a month right after the data was created.

    To make the backups of the critical data much quicker (and faster to restore), we put all the once a month 3rd party sourced data in a different database.  That allowed us a very simple method for separating the full backup schedules between the critical data and the data that changed only once a month.

    We didn't have to create any DRI or RI triggers between the two databases because the GUI's didn't use the once a month data at all (just the procs for the billing and invoicing did so no problem there).  But, if the GUI's did make entries into the critical database that required DRI to the monthly data, our plan to backup the once a month data just once a month would have been screwed... unless we decided to us RI triggers which, IMHO, are nearly as bad as cursors.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 3 posts - 16 through 17 (of 17 total)

You must be logged in to reply to this topic. Login to reply