Hi all!
I want to remove all white space in a specific field From a Table in sql server during fetching data from C# code. I want to take all table field but I want to remove spaces from only one field. i am taking data from another server.
Is there any query in which I remove white spaces in create view of that table. Please assist me.
My table fields are like..
user_id user_name user_password Sequence
1241 rajan121 12345 A - B - C - D - E
I want to remove white spaces from Sequence like (A-B-C-D-E).
Loading

Jignesh TrivediPosted Nov 21, 2013, 10:58 PM
agree with above answer you can use replace function to remove the space
select replace(' A - B - C - D - E',space(1),'')
refer
http://msdn.microsoft.com/en-us/library/ms186862.aspx
to know more about relace function
hope this will help you.
HanookPosted Nov 21, 2013, 6:33 AM
OUTPUT:
A-B-C-D-E
So the SELECT query as follows:
SELECT REPLACE ( sequence, ' ', '')
FROM TableName;
Jaganathan BantheswaranPosted Nov 21, 2013, 6:14 AM
Jaganathan BantheswaranPosted Nov 18, 2013, 12:40 AM
Try like this,
SELECT REPLACE(Sequence, ' ', '') from YourTable;