Hi delaap,
Just go through the following procedure
------------------------------------
CREATE PROCEDURE removeSpace AS
DECLARE @str VARCHAR(1000),
@primaryKey INT (declare it as character if you have a
character type primary key),
@i INT, @j INT
SELECT @i=COUNT(*) FROM myTable
SELECT @primaryKey=0 (initialise it with '' if it is char)
WHILE @i>0
BEGIN
SET ROWCOUNT 1
SELECT @primaryKey=myPrimaryKey,
@str=myColumn FROM myTable
WHERE myPrimaryKey>@primaryKey
SELECT @j=CHARINDEX(CHAR(13),@str)
WHILE @j>0
BEGIN
SELECT @str=STUFF(@str,@j,1,' ')
SELECT @j=CHARINDEX(CHAR(13),@str)
END
UPDATE myTable
SET myColumn=@str WHERE primaryKey=@primaryKey
SELECT @i=@i-1
END
SET ROWCOUNT 0
------------------------------------
This procedure will replace the data for one column you can run the same for multiple columns be creating/executing the dynamic sqls.
Let me know if it does not work.