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 9248489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:57:21+00:00 2026-06-18T09:57:21+00:00

If I call procedure on linked server, I get the following error: Msg 0,

  • 0

If I call procedure on linked server, I get the following error:

Msg 0, Level 20, State 0, Line 0
A severe error occurred on the current command. The results, if any, should be discarded.

It works in SSMS, also it works with classic asp, but not here. I have found some similar questions, but no answer. And I wont(can’t) connect directly to linked server and execute procedure locally. It must be executed as : myLinkedServer.Database.dbo.myProcedure

Any idea?

 using (SqlCommand getOutput = new SqlCommand())
        {

            getOutput.CommandText = "myLinkedServer.Database.dbo.myProcedure";
            getOutput.CommandType = CommandType.StoredProcedure;
            getOutput.CommandTimeout = 300;
            getOutput.Connection = conn;

            conn.Open();
            using (SqlDataAdapter da = new SqlDataAdapter(getOutput))
            {
                da.AcceptChangesDuringFill = false;
                da.Fill(exportData);//here error happened
                conn.Close();
                da.Dispose();
  • 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-06-18T09:57:22+00:00Added an answer on June 18, 2026 at 9:57 am

    I have found a solution:

    getOutput.CommandText = "EXEC myLinkedServer.Database.dbo.myProcedure";
    getOutput.CommandType = CommandType.Text;
    

    When calling a procedure on linked server, command type should be as text.

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

Sidebar

Related Questions

I'm trying to call a remote stored procedure over a linked server. The problem
I have the following procedure call in VB6: dim rs as adodb.command dim cnn
I've call a stored procedure (SQL Server 2005) in Excel 2007. This SP has
How to call a stored procedure from a user defined function in SQL Server
When an Asynchronous Procedure Call (APC) occurs it is executed 'Asynchronously' to the current
I'm able to execute a stored procedure which queries a Linked Server directly, but
I have a linkedserver that will change. Some procedures call the linked server like
I want to call stored procedure from a trigger, how to execute that stored
I want to call this procedure that sends one value that can be NULL
Below is my Oracle Procedure. When i call this procedure using java, it throws

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.