79773253

Date: 2025-09-24 04:14:52
Score: 1
Natty:
Report link

sqlcmd can’t always resolve (localdb)\MSSQLLocalDB because LocalDB uses a dynamic pipe name. From your output:

np:\\.\pipe\LOCALDB#8DB1A806\tsql\query

Try connecting with the full pipe path:

sqlcmd -S "np:\\.\pipe\LOCALDB#8DB1A806\tsql\query" -E

If that works, the issue is usually:

  1. Old sqlcmd version – update to the latest SQL Server Command Line Utilities (2022).

  2. Wrong executable in PATH – run where sqlcmd to check.

SSMS resolves LocalDB automatically, but older sqlcmd often does not.

Reasons:
  • Has code block (-0.5):
  • Starts with a question (0.5): can
  • Low reputation (1):
Posted by: Ajin Aniyan