I'm trying to use sqlcmd utility and the query is working I'm just wondering how I can get just the value without fieldname and those dashes?
$res = sqlcmd -Q @"
:Connect .
use [Database1]
select firstname from customer
"@
$res
Output:
firstname
--------------------------------------------------
John

You need
-h -1,-m 1andset nocount on;Try this: