Monday, March 26, 2012

Linked views

I have a number of databases on the same SQL Server that all use tables from
a database called RestaurantMgr (also on ths server). I have been accessing
these table using linked views (eg. create view Branches as select BranchID,
BranchName from RestaurantMgr..Branches).
Is this the best way to do this ? Or should I be using something else like
replication, triggers to copy data accross, DTS ?
Linked views seem the simplest method, but if there is a reason not to use
this method, then I want to find out what it is.
Thanks, CraigIf these views aren't referencing large tables or they do not return large
result-sets, then this solution is good enough.
But for read-intensive operations it would be better to keep the actual data
in the same database - this way more appropriate indexes can be created if
necessary.
Of course changes to the original tables would need to be propagated to the
other databases through the use of triggers.
ML|||Thanks for the advice, ML.
When you say that data will "need to be propagated to the other databases
through the use of triggers", does that it is better to use triggers for thi
s
than DTS, replication or any other method.|||Well, triggers are immediate and simple to design. But the destination
database must be available to the trigger at the time of execution.
Maybe using replication might be more efficient. Of course it would need to
be immediate. But do consider whether you should allow the subscribers to
modify the data.
MLsql

No comments:

Post a Comment