BTW the workaround is use SQLCMD from an earlier version so this is not a blocker but a big inconvenience only
Bug in SQLCMD V15.0.4138.2 found in SQL 2019 - can this get fixed please?
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;"
or
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;"
4 answers
Sort by: Most helpful
-
-
Erland Sommarskog 113.3K Reputation points MVP
2022-02-08T22:26:45.533+00:00 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.
-
Brian Abraham 6 Reputation points
2022-02-08T23:47:23.373+00:00 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.
-
CathyJi-MSFT 22,321 Reputation points Microsoft Vendor
2022-02-09T07:55:37.8+00:00 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".