How to query a Sql in another server

  • select * from [servername].[dbname].dbo.[tablename]?

    This is throwing error

    Could not find server 'FDOPROD2:51005' in sys.servers. Verify that the correct server name was specified. If necessary, execute the stored procedure sp_addlinkedserver to add the server to sys.servers.

    Where should we give connection string for sqlauthentication?

  • Sorry now the error is

    Server 'FDOPROD1\FDOPROD1' is not configured for DATA ACCESS

  • USE [master]

    GO

    EXEC master.dbo.sp_serveroption @server=N'YourServerName', @optname=N'data access', @optvalue=N'true'

    GO

    you can use this script to add the data access permission in the linked server

Viewing 3 posts - 1 through 2 (of 2 total)

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