Custom delimiter in SQL Server set in “Results to Text” options doesn't work

无人久伴 提交于 2020-12-06 11:32:10

问题


I am interested in saving the result of a SQL query, like a SELECT statement, as a pipe (|) delimited text file in SSMS.

I can do that using the Export wizard.

However, it seems there's a simpler method by setting a "Custom delimiter" in Tools>Options under Query Results>SQL Server>Results to Text as shown here:

Then, if I specify "Results to Text" or "Results to File", I am supposed to get the pipe delimited result.

This is also outlined here:Obtaining Pipe Delimited Results from SQL Server using SSMS

But, doing this I still get the usual output with either Results to Text or File.

I don't know what I'm missing or doing wrong.

Thanks for your help.


回答1:


Thanks to @AlexYu, the answer is simply applying the "turning it off and on" trick. Closing and re-opening SSMS is required before the change in this setting takes effect.

Incidentally, disconnecting and re-connecting to the SQL server doesn't work in this case. I have done some rudimentary tests and it seems this also applies to other options here, for example under Query Results>SQL Server>Results to Grid.

I was using Microsoft SQL Server Management Studio v17.9.1, build number 14.0.17289.0.



来源:https://stackoverflow.com/questions/54853827/custom-delimiter-in-sql-server-set-in-results-to-text-options-doesnt-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!