Groups | Blog | Home
all groups > sql server (alternate) > december 2004 >

sql server (alternate) : SQL field sep question


thepoop NO[at]SPAM mindspring.com
12/28/2004 6:18:10 PM
currently my select produces the following output:

"a", "b", "c"

I would like it to be:

a | b | c

does anyone know of a way to eliminate the double quotes and substitute
the pipe for the comma ?

thanks,
John Bell
12/29/2004 8:51:56 AM
Hi

Are you saying that you have double quotes in the data? Posting DDL (Create
table statements etc...) http://www.aspfaq.com/etiquette.asp?id=5006 and
example data as insert statements http://vyaskn.tripod.com/code.htm#inserts
would help to remove any ambiguity in the questions

For example:
CREATE TABLE myTable ( col1 char(1), col2 char(1), col3 char(1) )

INSERT INTO MyTable ( col1, col2, col3 ) Values ( 'a', 'b', 'c' )

SELECT Col1, Col2, Col3 FROM MyTable

/* Returns
Col1 Col2 Col3
---- ---- ----
a b c

(1 row(s) affected)
*/

SELECT Col1 + '|' + Col2 + '|' + Col3 FROM MyTable
/* Returns

-----
a|b|c

(1 row(s) affected)
*/

John

[quoted text, click to view]

AddThis Social Bookmark Button