Linked Servers ARRRRGGGGGGGG

  • This is doing my nut.

    I want to query an instance of sql2000 on a cluster from a sql 7.0 machine. The problem is that there is a bug that won't allow the passing of windows credentials from 7 to 2000. This is further complicated, for me, by the naming convention of the cluster where each instance of SQLServer is of the form SQLPRD1\SVS1 and SQLPRD2\SVS2. The backslash is not allowed as part of the server name in the distributed query !!!!!

    Suggestions please before I completely lose the plot

  • Try an alias for the instance.

    Andy

  • I'm not for certain because I don't have your environment, but I'm pretty sure if you use square brackets around the [SQLserver\Name].dbname.owner.table it will work for you.

    Let us know.

    Tom Goltl

  • Yup. Sorry for not getting back. I found both of those after some more searching.

    Thanks a million

  • TRUNCATE TABLE [AHL_SQL7\WORKSPACE].MarketingCF.dbo.Mthly_LIF

    GO

    Server: Msg 117, Level 15, State 1, Line 1

    The object name 'AHL_SQL7\WORKSPACE.MarketingCF.dbo.' contains more than the maximum number of prefixes. The maximum is 2.

    Suggestions?

     

  • Please pardon my ignorance, but how do you create an "alias for the instance?"

    Thanks,

    Kip

     

  • Open client network utility. Click on the alias tab and click Add. In the alias box, type in server_name, Under server Name box type in the Servername\instance_name.

     

  •  

    TRUNCATE TABLE can't be run directly against the four-part name associated with a linked server. You'll need to wrap this up with an sp_executesql:

    EXEC [AHL_SQL7\WORKSPACE].MarketingCF.dbo.sp_executesql N'TRUNCATE TABLE Mthly_LIF'

     

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply