Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6050761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:43:29+00:00 2026-05-23T07:43:29+00:00

I want to run SQL Server query on the remote machine and this is

  • 0

I want to run SQL Server query on the remote machine and this is what I am doing

EXEC sp_addlinkedserver 
   N'remote-server',
   N'SQL Server';
//I don't want to do this step, and want to use trusted connection to remote server
EXEC sp_addlinkedsrvlogin 'remote-server', 'false', NULL, 'sa', 'mypassword';

select * from [remote-server].[db_test].[dbo].[test_table];

EXEC sp_droplinkedsrvlogin 'remote-server',NULL;
EXEC sp_dropserver 'remote-server', 'droplogins';

I want to use the trusted connection to remote server, Is there any way so I can skip the username and password giving step and use the trusted connection as -T switch do in bcp utility?

or any other workaround? Currenty if I skip the sp_addlinkedsrvlogin then the distributed query select * from [remote-server].[db_test].[dbo].[test_table]; gives authentication failed error.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T07:43:29+00:00Added an answer on May 23, 2026 at 7:43 am

    Try using EXEC sp_addlinkedsrvlogin ‘remote-server’ without other parameters

    check the link http://msdn.microsoft.com/en-us/library/ms189811(v=SQL.90).aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I want to run this sort of query in SQL Server, how can
I want to run a query over a table in SQL Server to save
I have a query from SQL Server which I want to run in Mysql.
I want to run a query programmatically using java on a sql server database
I want to run a query on both Oracle and SQL Server. The problem
We want to use SQL SERVER 2008 Full Text Search and seem to run
I want to run parameterized SQL with .NET. But when I use AddWithValue() the
I want to run a sql query on a specific schedule (weekly) and need
Why this code don't work,when i want run this code vwd 2008 express show
I use SQL Server Import and Export Wizard to transfer data from a remote

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.