November 9, 2006 at 4:37 pm
There must be a way to do a Foreign key reference across databases in one DB server besides triggers. No?
DatabaseA.Table.Field references DatabaseB.Table.Field
November 9, 2006 at 5:12 pm
If you need to reference data in 2 tables by FK that means those tables are parts of the same database.
Separation of them was (is) a mistake and must be fixed.
_____________
Code for TallyGenerator
November 9, 2006 at 5:43 pm
Nope... other than moving the table as Serqiy suggested (and, is actually the correct way to do it!), the only other way is by trigger...
--Jeff Moden
Change is inevitable... Change for the better is not.
November 13, 2006 at 12:10 pm
Bah, Sybase allow it just fine. In the references clause just add DB qualifier. MS does not allow it that hardly means it is wrong. You are thinking invoices and orders types of scenarios.
But... if many databases share info in one database, then if that one goes down, then they all go down right? Well yes, but what if you have one database and that goes down.
There are ways or using databases to express ideas that are not exactly customers, invoices and orders. In those cases sharing data with triggers and such you would have to do in SQl Server is not such a good idea. I totally agree. But if the DBMS allows it directly in the FK references clause why not? MS does not grant that feature that hardly makes it a bad idea. A bad idea in SQl server I agree, but a bad idea as a blanket statment, I disagree.
Sybase allows it, SQL Server does not. Wonder about Orcle? Microsoft need to protect you from your self and you regurgitate thier lack of features it like a benifit. MS dows allow it with DPV btw. Ehhh pointless to argue it. Ok your right and I am wrong.
November 13, 2006 at 1:02 pm
Eric, actually Invoices and Orders must be IN THE SAME TABLE, not to mention database.
Separating it is breaking of relational model, just a little bit.
Placing it into different databases - logical mistake.
_____________
Code for TallyGenerator
November 13, 2006 at 1:10 pm
How about on 2 different servers??
November 13, 2006 at 1:19 pm
Eric,
PPl are trying to help and if you don't want to know how its done in SQL Server then don't post it here. I hope u understand this site is called SQLSERVERCENTRAL not ORACLECENTRAL OR SYBASECENTRAL.
Thanks
Sreejith
November 13, 2006 at 1:25 pm
That what I'm dealing with. Bloody 3rd part application.
And what causes my deepest frustration.
It's funny, but in order to work with it people load the whole database across servers line-by-line. And they wonder why both servers and network are so busy.
_____________
Code for TallyGenerator
November 13, 2006 at 1:40 pm
Dare I ask???
How big are the dbs (size and rows)?
November 13, 2006 at 2:19 pm
Fortunately it's not big. Yet.
Under 1GB all together.
But even with this amount of data it takes up to 40 seconds to update web-page. Because server is too busy with "more important" activity caused by "genius" design.
_____________
Code for TallyGenerator
November 13, 2006 at 2:24 pm
Sounds to me like it's 41 seconds too long!!!
I think you should put your foot down on this one .
November 13, 2006 at 4:24 pm
Heh, heh.... I LOVE "genius" designs... life would be so boring if everyone did things right
--Jeff Moden
Change is inevitable... Change for the better is not.
November 13, 2006 at 4:50 pm
And it actually gave me this job...
When they hit the wall they started to look for a professional.
But not when they started the project.
Now I'm watching the same situation in another project. Gonna be a good reason to discuss a pay rise...
_____________
Code for TallyGenerator
November 13, 2006 at 6:31 pm
Heh... I know what you mean... my Co hired me because they were an Oracle shop suddenly thrust into the world of SQL Server ... all they wrote was RBAR (I love that "Modenism" ) with lots and lots of useless very long winded multi-level transactions ... they even had (still have) an Oracle-like sequence table because they didn't know what an IDENTITY column was... and, they had an average 4,000 deadlocks per day (got that down to 12 a week and hit the goose egg one week), several server wide outages per day because of blocking, and dozens of 8-12 hour runs on just a couple thousand rows each to go right along with all that garbage.
And, like you imply, they keep doing the same thing over and over... implement, then think... code, then design. Pure genius and keeps me plenty busy. I've tried to show them the light and they get "the religion"... right up until someone gives them a ridiculous development schedule and they katow with a mighty "Yes BOSS"! Then, they turn to the users and say "Would you help us design the database"? That's when they really get into deep Kimchie.
What's even better is when they outsource an SQL Server user-designed solution and then wonder why they have performance and scalability problems . Gotta love those managers that try to hit a schedule mark instead of doing it right the first time ... they're good for everyone's wallet except for the company they work for!
--Jeff Moden
Change is inevitable... Change for the better is not.
November 14, 2006 at 7:01 am
Keep his phone number in your black book... it might be handy for me one day .
Viewing 15 posts - 1 through 15 (of 17 total)
You must be logged in to reply to this topic. Login to reply