You are here: Re: How do I reference a table in one database from a SQL script running in another database? « MsSQL Server « IT news, forums, messages
Re: How do I reference a table in one database from a SQL script running in another database?

Posted by Erland Sommarskog on 01/06/07 13:36

MC (marko.NOSPAMculo@gmail.com) writes:
> Let me just add something here.
> You need to check for performanse before deciding to go that way. If you
> need high performance, triggers really need to be tested before you commit
> yourself in doing things that way.

Not to forget that triggers are more difficult to implement than foreign
keys. Not that it's rocket science, but just simply more boring coding
into which sloppy errors easily can creep in.

Also, if there are multiple databases, design for the situation that you
want to run two environments on the same server. Hardcoding database names
defeats that purpose. On SQL 2005 synonyms can be used to address the
problem.

--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация