why is sqlcmd command not found server ?

Dong Lam trien 1 Reputation point
2022-05-12T09:59:38.66+00:00

in LAN I have installed 2 to 3 sql severs but when using sqlcmd -L command I only see 1 server at the location using this command, why does sqlcmd -L command not see other sql sever servers in the network LAN ?

SQL Server Other
{count} votes

5 answers

Sort by: Most helpful
  1. Dong Lam trien 1 Reputation point
    2022-05-12T10:01:09.797+00:00

    I work as a LAN Lab and install sql server for several machines, right at the machine where sql server is installed I use the command: sqlcmd -L to check if the server is found but this command can't find, this computer i am

    using sql server 2008 pro and win10 21H1, you see attached image file

    201319-sql-err.jpg

    Also this command sqlcmd -L I went to see sql server again, this computer i am using win7 ultimate, do you know why this error ?

    201359-sql-err2.jpg

    0 comments No comments

  2. Olaf Helper 47,436 Reputation points
    2022-05-12T10:38:12.933+00:00

    See https://learn.microsoft.com/en-us/sql/tools/sqlcmd-utility?view=sql-server-ver15
    => Parameter -L[c] => Note
    Because of the nature of broadcasting on networks, sqlcmd may not receive a timely response from all servers. Therefore, the list of servers returned may vary for each invocation of this option.

    That function was never reliable.


  3. Seeya Xi-MSFT 16,586 Reputation points
    2022-05-13T05:47:51.01+00:00

    Hi @Dong Lam trien ,

    Welcome to Microsoft Q&A!
    Please refer to this document about SQL Server in Windows operating system: https://learn.microsoft.com/en-us/troubleshoot/sql/general/use-sql-server-in-windows
    You can use this table in the above link to check if your operating system supports your current version of SQL Server.

    Best regards,
    Seeya


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  4. Seeya Xi-MSFT 16,586 Reputation points
    2022-05-16T06:50:08.537+00:00

    Hi @Dong Lam trien ,

    Hope everything goes well. Here is a related case which may give you some help.
    https://learn.microsoft.com/en-us/answers/questions/847351/scan-for-sql-servers-on-network.html
    In order to benefit all community members who are having this similar issue, please choose an answer to accept or vote for the answer you think is useful to you. Your contribution is highly appreciated.

    Best regards,
    Seeya

    0 comments No comments

  5. Tom Phillips 17,771 Reputation points
    2022-06-13T15:17:01.007+00:00

    There are many reasons why sqlcmd -L will not show a SQL Server. There is not a reliable way to "detect" from machine on the network a SQL Server is running somewhere on the network.

    What is your purpose for trying to use sqlcmd -L?

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.