Powershell truncating SQL Query Output

前端 未结 1 1036
星月不相逢
星月不相逢 2021-01-25 21:29

I\'m running the following query from a powershell command which unfortunately truncates or adds dots to the end of the result string. I had adjusted the screen buffer size for

相关标签:
1条回答
  • 2021-01-25 22:16

    Thanks to everyone who's replied. I had formulated a bcp line below to get me the non-truncated result from varbinary to string.

    bcp "SELECT CAST(BINARYCOL AS VARCHAR(MAX)) FROM OLTP_TABLE WHERE ID=123123 AND COMPANYID=123" 
    queryout "C:\Users\USER\Documents\ps_scripts\res.txt" -c -S myserver.db.com  -U admin -P password
    
    0 讨论(0)
提交回复
热议问题