Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Adding a delimiter "|" at the end of every row

Author  Topic 

kxd11
Starting Member

4 Posts

Posted - 2011-07-05 : 19:44:17
I have export the data out of a table with a million rows with a delimiter ( | ) between each column, how can I add the pipe delimiter at the end of each row, You can't use the same delimiter for CR & to separator the columns.

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2011-07-05 : 20:22:02
How are you doing the export? BCP? SSIS? something else? Depending on the method, it may allow you to specify column separator and row separator.
Go to Top of Page

kxd11
Starting Member

4 Posts

Posted - 2011-07-05 : 20:37:10
I've try export & SSIS.
Go to Top of Page

Lumbago
Norsk Yak Master

3271 Posts

Posted - 2011-07-06 : 03:00:41
How about adding it as a part of you last column?

SELECT Col1, Col2, Col3 = Col3 + '|'
FROM table

- Lumbago
My blog-> http://thefirstsql.com/2011/02/07/regular-expressions-advanced-string-matching-and-new-split-function-sql-server-2008-r2/
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2011-07-06 : 03:45:28
The question is:
Why should a column delimiter be added at the end of the last column?


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -