Tsql Statement

Morning, I'm in the process of doing a conversion and exporting data out of sql 2005 to a csv file. One of my fields have over a few thousand entries with uneeded characters. example

{\rtf1\ansi\deff0\deftab720{\fonttbl{\f0\fswiss MS Sans Serif;}{\f1\froman\fcharset2 Symbol;}{\f2\fswiss Tahoma;}{\f3\fswiss Tahoma;}}  {\colortbl\red0\green0\blue0;\red0\green0\blue255;\red0\green0\blue128;}  \deflang1033\pard\plain\f2\fs17   \par }

  thats just from one row is there a quick way to do it rather than use the replace statement with multiple replace? And how would I go about it?

Thanks
Tech315Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
lcohanConnect With a Mentor Database AnalystCommented:
"
I was thinking of how do you replace everything with in the { } in one shot
"


you mean the whole data in that column is useless? Sorry if I missed the point....if the string is always the same then REPLACE SQL function might be for you. if not....you need to work on pieces or use a PATINDEX to find the patern position you need to replace, and use a SUBSTRING with PATINDEX like in example below:

http://stackoverflow.com/questions/4685114/sql-server-2005-query-substring-patindex
http://stackoverflow.com/questions/1839643/sql-output-a-substring-based-on-a-search-pattern-ensuring-first-last-strings-a
0
 
lcohanDatabase AnalystCommented:
You could do that by using SQL REPLACE function if you really need to get rid of OR use BCP to export from SQL to txt or csv file for text columns data.
0
 
Tech315Author Commented:
I was thinking of how do you replace everything with in the { } in one shot
0
 
Tech315Author Commented:
Thank You
0
All Courses

From novice to tech pro — start learning today.