June 12, 2006 at 8:17 am
June 13, 2006 at 10:56 pm
Make your code refer to a "linked server" and use a 4 part naming convention everywhere in your code. Then, you can just repoint the linked server at whatever box you want including the box your code is on.
See Books Online for how to create and grant permissions on a linked server. Start with lookup on [sp_AddLinkedServer].
--Jeff Moden
Change is inevitable... Change for the better is not.
June 14, 2006 at 7:05 am
Thanks Jeff, but what if the database name may be something different and the owner may be different? I was wondering if I wrote views local in my app DB that did select * from each of the soruce tables, that way all I'd have to do is change the 3 parts of the 4 part convention? I wasn't sure what performance would do though with select * views being merged together and crossing linked servers though.
June 14, 2006 at 7:36 am
Sorry about the confusion on the owners... I'm used to folks putting everything into production as "dbo". Yes, the views you speak of would certainly and easily solve that problem without adding much overhead so long as they are truly "pass through views" (ie, SELECT * FROM 3parttablename) with no calculations, joins, or criteria.
Not sure what you mean by "views being merged together", though... probably not enough coffee, yet...
--Jeff Moden
Change is inevitable... Change for the better is not.
June 14, 2006 at 7:41 am
June 14, 2006 at 5:09 pm
I have an SQL Server based IVR at work (actually, 400 miles away from the main DB)... it uses a linked server connection with multiple pass through views as you have suggested. What takes 10 minutes to do on the local box takes 30 minutes to do from the IVR. There's a 3 to 1 hit on performance probably due to the VPN speeds. One of the Insert/Selects uses joins between 5 tables... doesn't seem to be a problem. I suspect 3 to 1 is the absolute worst you would see.
We also have linked servers between local servers with a pretty good LAN. There is some degradation in performance but it's not as bad as you would think. Updates seem to take the biggest hit at something less than 2 to 1. Selects seem to run at something less than 1.25 to 1.
--Jeff Moden
Change is inevitable... Change for the better is not.
June 14, 2006 at 7:41 pm
Very good, we will rely on SQL Views to write our code against then in conjunction with linked servers. Thanks for the insight.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply