|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Tuesday, January 15, 2013 5:50 AM
Points: 108,
Visits: 122
|
|
I am trying to create a synonym as follows:
Synonym name: Product Synonym schema: dbo Server name: 06dw Database name: [06websql\websql] Schema: dbo Object type: this is blank Object name: Product
I have tried SO MANY different scenarios for the server name, with and without brackets, with the database name, et cetera. . .
My linked server is listed as: 06WEBSQL\WEBSQL
I cannot get ANYTHING to work as far as a synonym is concerned with this bloody linked server. However, I can use openquery, but I don't want to.
Does anyone have any suggestions please?
Thanks in advance,
~D
|
|
|
|
|
SSCarpal Tunnel
       
Group: General Forum Members
Last Login: Thursday, May 16, 2013 8:29 AM
Points: 4,804,
Visits: 8,067
|
|
|
|
|
|
SSC-Insane
         
Group: General Forum Members
Last Login: Yesterday @ 7:36 PM
Points: 21,357,
Visits: 9,535
|
|
Gianluca beat me to it, but this is straight from BOL (Create synonym).
Assuming you didn't reverse the db and server in your question, this should work :
EXEC sp_addlinkedserver '06dw'; GO USE tempdb; GO CREATE SYNONYM dbo.Product FOR [06dw].[06websql\websql].dbo.Product; GO
The addlinkedserver needs to be executed only once for that server no matter how many synonyms you need.
This is also another way to make sure the create synonym works.
Do Select * FROM [06dw].[06websql\websql].dbo.Product
When that query works, the create Syn. should also work.
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Tuesday, January 15, 2013 5:50 AM
Points: 108,
Visits: 122
|
|
Gianluca Sartori (6/16/2010)
I think you confused server and database. Does this work? CREATE SYNONYM [dbo].[Product] FOR [06WEBSQL\WEBSQL].[06dw].[dbo].[Product]
This worked! Thank you!
I was about to throw my desk through the wall. . .
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Friday, May 17, 2013 11:31 AM
Points: 1,157,
Visits: 3,077
|
|
pics pl0x
______________________________________________________________________________________________ Forum posting etiquette. Get your answers faster.
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Tuesday, January 15, 2013 5:50 AM
Points: 108,
Visits: 122
|
|
|
|
|