SQL Ssis
SQL Ssis
Username:
Password:
All Forums
SQL Server 2000 Forums
Transact-SQL (2000)
How to replace a comma with a space in a field
Author
Reply to Topic
Printer Friendly
Topic
Posted - 04/05/2007 : 18:28:32
jej1216
Starting Member
27 Posts
russell
Pyro-ma-ni-yak
USA
5072 Posts
sshelper
Posting Yak Master
216 Posts
UPDATE YourTable
SET Name = REPLACE(Name, ',', ' ')
SQL Server Helper
http://www.sql-server-helper.com
Posted - 04/06/2007 : 00:08:14
russell
Pyro-ma-ni-yak
USA
5072 Posts
jej1216
Starting Member
Great - thanks.
27 Posts
madhivanan
Premature Yak
Congratulator
quote:
Originally posted by russell
India
22864 Posts
Johnnymarvellous
Starting Member
10 Posts
Hello,
I used the REPLACE example given above for a similar problem
and thank you, I now have no commas in the text, however I
now have a new problem.....
The column in question would apear in the extract file with a
lenght of 50 charaters, however, since using the REPLACE
command, the column is now 500+ characters in length (which
is making a mess for the downstream system)
If I then try to wrap the replace section to try and CAST,
CONVERT or RTRIM, it simply returns an error.
Can anyone tell me:
a. why has the column grown to half a mile in length
b. how can I stop this/shorten the output for this column.
You can probably tell, I'm not that experienced with SQL,
thanks.
JM
Posted - 06/22/2007 : 11:24:24
madhivanan
Premature Yak
Congratulator
India
22864 Posts
Can you post some sample data and the query you used?
How can replacing comma result in increasing the length?
Also post this as new topic to get more replies
Madhivanan
Failing to plan is Planning to fail
Johnnymarvellous
Starting Member
10 Posts
JM