Hello,
I have a SSMS query result set that includes columns which contain commas. I used the save as feature in the Results pane in SSMS but saves it as a comma delimited file. I tried to change the delimiter using in Query Options/Custom Delmiter to semi colon however it still saves it with a comma delimiter.
Any suggestions on how to change the delimiter?
Thanks
Are you using the save to file option for the query or are you selecting all the data and then saving it?
I ran this test, and I got the commas into a single column. The difference is that I made the file type *.*, and used a .TXT extension.
CREATE DATABASE TEST;
GO
USE TEST;
GO
CREATE TABLE TestComma (column1 varchar(30));
GO
INSERT INTO TestComma
VALUES ('This is a comma, test')
INSERT INTO TestComma
VALUES ('This is a comma, test')
INSERT INTO TestComma
VALUES ('This is a comma, test')
INSERT INTO TestComma
VALUES ('This is a comma, test');
GO
-- Now run this to save output into text file:
SELECT * FROM TestComma;
GO
-- Use the Save as feature:
SELECT * FROM TestComma;
GO
|||I selected all data in the query results window then saving it. The only option is to save it as a .csv file and I was wondering if that can be changed.|||As I mentioned, use the *.* file type, and then specify a name. Then it's just text and not formatted as a CSV.
No comments:
Post a Comment