Bug in SQLCMD V15.0.4138.2 found in SQL 2019 - can this get fixed please?

Brian Abraham 6 Reputation points

We are using SQL 2019 to load SQL scripts using the SQLCMD utility. the utility hangs whenever we try to use the -c (command separator) option. This just stopped working in SQL 2019 and is confirmed to work in all prior versions.

Here is an example that will not work in SQL 2019

C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn>sqlcmd -c ; -S "ServerName" -d "DBName" -E -Q "SELECT TOP 1 * FROM TableName;"


C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn>sqlcmd -c ";" -S "ServerName" -d "DBName" -E -Q "SELECT TOP 1 * FROM TableName;"

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,877 questions
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Brian Abraham 6 Reputation points

    BTW the workaround is use SQLCMD from an earlier version so this is not a blocker but a big inconvenience only

    1 person found this answer helpful.
    0 comments No comments

  2. Erland Sommarskog 102.2K Reputation points

    It does not hang on my machine, but I don't get any result back.

    This is a peer-to-peer forum for help. To report a bug, the place to go is https://feedback.azure.com/d365community/forum/04fe6ee0-3b25-ec11-b6e6-000d3a4f0da0.

    If this is a blocking issue for you and you need a fix, you need to open a support case.

    0 comments No comments

  3. Brian Abraham 6 Reputation points

    I agree - it does not necessarily hang but it definitely is a bug and does not work. I need to access a SQL forum - microsoft needs to know this is not working.

  4. CathyJi-MSFT 21,096 Reputation points Microsoft Vendor

    Hi @Brian Abraham ,

    I run the command that you offered, then I got below information.


    But if I removed the –c parameter, I got the correct result.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    0 comments No comments