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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:34:01+00:00 2026-05-23T20:34:01+00:00

Have a Sql Script file name spCreation.sql with the following contents. CREATE PROCEDURE dbo.usp_select_customers

  • 0

Have a Sql Script file name spCreation.sql with the following contents.

 CREATE PROCEDURE dbo.usp_select_customers
 as
 Begin
    SELECT EMP.NAME, EMP.ID FROM analysis.customerDB.dbo.employeetbl
 END

Open this file and execute on Queryanalyser, without creating a Linked Server “Analysis” it is not throughing any error and query executed successfully.

Execute the same sql file through sqlcmd like follows on command prompt.

sqlcmd -s [Server] [Database] [Login] [Password] spCreation.sql

it is throwing an exception for the notify server.
Can any one explain how sqlCmd execution behaviour and query analyser execution behaviour?

Error message follows

Msg 7202, Level 11, State 2, Server VIJAY-PC, Procedure usp_select_customers, Line 4 Could not find server ‘analysis’ in sys.servers. Verify that the correct server name was specified. If necessary, execute the stored procedure sp_addlinkedserv er to add the server to sys.servers.

  • 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-23T20:34:01+00:00Added an answer on May 23, 2026 at 8:34 pm

    Running the query in SSMS gives the very same error:

    Msg 7202, Level 11, State 2, Procedure usp_select_customers, Line 4
    Could not find server ‘analysis’ 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.

    So the problem is not the difference between sqlcmd or SSMS, it must be something else. For instance you’re running against a different machine, or you simply don’t run it in SSMS but simply check the syntax.

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

Sidebar

Related Questions

I have a migration that runs an SQL script to create a new Postgres
For example, say I have this SQL Script: create table Person ( id int
I have (another) question about indexing. I use the following code: CREATE TABLE [dbo].[PnrDetails1](
So I have this spool file having this kind of content. SQL> select file_name
I have a SQL script that inserts data (via INSERT statements currently numbering in
I have a SQL script that populates a temp column and then drops the
I have a SQL script which is extremely large (about 700 megabytes). I am
We have an sql build script, with oracle 10.2. At the end of the
I have a 500,000 line SQL script: UPDATE users SET region_id = 9814746 WHERE
Hello I have a very large SQL script and while trying to execute it

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.