SQL Server Linked Server during Development
I am creating a SQL Server database (call it a) on my development system (call it A), which nee开发者_StackOverflow社区ds data from another production-database-server (b, on Server B).
So, I set up the other server as a linked server. No problem so far.
When finished that database (a) should run on server B, so there would be no more need for a linked server.
But in my STPs I got a lot of B.b.dbo.tablename which would need to be altered to simply b.dbo.tablename...
I want to avoid this.
Any idea how I can do this.
Would it be a severe performance hit, if I simply set up a Linked Server on B pointing to itself (if that is possible)...?
Hope I could make sense!
Thank you, Reinhard
You could use the linked server referring to itself.
However, an easier way might be use a synonym that hides the 4 part name.
CREATE SYNONYM dbo.myLocaltable FOR LinekdServer.dbname.dbo.myLocaltable
or
CREATE SYNONYM myLocaltable FOR LinekdServer.dbname.dbo.myLocaltable
This way, all references to myLocaltable will be, er, local.
精彩评论