December 4, 2012 at 9:21 am
Hi All,
Could you please let me know the possibilities of creating a view based on a table that exists in a different server.
Thanks
December 4, 2012 at 9:26 am
its certainly possible, you'd probably want to create a linked server to the other server, and then create the view with a full four part naming convention.
CREATE VIEW
AS
SELECT ColumnList
FROM MyLinkedServer.DatabaseName.dbo.TableName
Where SomeColumn = SomeCriteria
now be warned: linked servers can be SLOW, especially if the tables on the linked server are huge...data usually gets copied over to the temp db, and then filtered. that's defintiely the case if you join that linked table to some local table...all the data is copied, then joined, then filtered, then returned as the results of a query.
If you know the data doesn't change much, I'd suggest replicating a copy to a local table instead, and refreshing it on some regular interval.
Lowell
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply