0

I am firing a SQL query through command prompt

 H:\>sqlcmd -S cx-siscsqltest\sqlinst  -Q "select serverproperty('servername'), serverproperty('Edition'), SERVERPROPERTY('ProductVersion'), SERVERPROPERTY('Productlevel') "

The output is returning huge spaces, can you please help me remove those spaces? I have to use this output in xml

5
  • stackoverflow.com/questions/10561961/… or stackoverflow.com/questions/33738433/… maybe Commented Jul 13, 2017 at 11:43
  • Please provide an example of what you mean by "The output is returning huge spaces". Commented Jul 13, 2017 at 11:43
  • Have you tried casting your result to a smaller NVARCHAR ? Commented Jul 13, 2017 at 11:46
  • Note that SQL Server has full support for XML (FOR XML AUTO, FOR XML PATH) so you may be able to get the result you're after without further formatting. Commented Jul 13, 2017 at 11:47
  • @underscore- above command returns 4 col and 1 row , each data occupies 100 lines Commented Jul 13, 2017 at 11:49

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.