473,546 Members | 2,205 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Remove all spaces in a column.

2 New Member
Hey all

I have a column of user membership ids that is 8 characters long. These ids are based on the users surname with number added on the end to uniquely identify each user.

My problem is that if the users surname is short, there are spaces between the end of the surname and the numbers.

There are 18000 or so members in the database which is repopulated from the source database every night.

The reason that i am trying to do this because the users enter their id without spaces in an online system developed in asp.net 2.0 and visual studio 2005.

Can i do this with sql or is there another method that will work here.
Mar 30 '07 #1
2 13313
MrWarlock
2 New Member
I’ve used REPLACE in ORACLE SQL to do something similar. In MySQL I think the syntax is this:-

UPDATE table_name
SET field_name = REPLACE(field_n ame,' ', '')


Basically you're replacing sapces ' ' with a null '' which should work.
Mar 30 '07 #2
hyperlez
2 New Member
Thanks. This is the sort of thing that i had been trying to do.

I have now worked out that my version of the gui i am using, does not seem to support the sql statement even though it reconises the key works.

thanks again
Apr 4 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
7397
by: ITM | last post by:
Can anyone tell me how I can prevent Access adding trailing spaces when I insert a value into a Text column? For example, if I execute the following statement: UPDATE Log SET Log.Title = 'Testing' WHERE Log.Identifier=1; ....then the following statement:
11
14981
by: gopal srinivasan | last post by:
Hi, I have a text like this - "This is a message containing tabs and white spaces" Now this text contains tabs and white spaces. I want remove the tabs and white spaces(if it more than once between two words). Is there any function we have in C which will find out the tabs and white spaces and returns the...
11
5529
by: Steven Smith | last post by:
When this event is triggered the following exception error occurs: 'System.Data.SyntaxErrorException' Missing operand after 'of' operator. So presumably it doesn't like the spaces in the column name, is there any way of temporarily renaming the column for this procedure, or will I have to rename the column in the database, regenerate...
1
9867
by: feucos | last post by:
Hi all, I am new to these so plz never mind if this is funny. here is my problem : Table : moody Column : Title
15
15600
by: DanielJohnson | last post by:
I am writing a program in which I am removing all the spaces from the string. I thought that I could do it two ways. One was parsing the string character by character and copying onto another output string. But this was trivial. The other option is to use pointers and shift all the characters after the space by one space to the left. I did...
3
27110
by: kbaisch | last post by:
I have a column in a table in an SQL server that has unwanted spaces. I have tried this code and it doesn't work. UPDATE Petersburg_ SET Residence_ = REPLACE(Residence_,',',','); Column data looks like this: AKIAK, AK PETERSBURG,AK I don't want any spaces in front, between or end.
3
3768
by: ShaeMills via AccessMonster.com | last post by:
In my table I imported from .txt, one of my columns has blank spaces. The column is as follows, how do I eliminate the blank spaces in between the second and third, and fifth and sixth digits? 12 345 6789 78 241 5869 04 258 3695 14 254 1136 00 045 0285
4
2989
by: koutoo | last post by:
If I have a text file that is delimited by spaces, how do I import it and get to comma delimited? Here is a row of data from the text file: 1 1 10:55:14 2 65 8.5 1.4+1.1 2.5 Class-2 0 I tried a few examples from the group and it didn't work, since the file also has a header row and a row of...
5
3252
by: danield | last post by:
Hello All, I have a query that I use to create another table: SELECT column1 & " " & column2 INTO table2 FROM table1 The problem is that sometimes there is no value in column1 and then the new entry in table2 is 'space' and then column2. For example if first column has '1' and second column has '2', the new record in the table2...
0
7507
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7435
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7698
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7947
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7461
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7794
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5361
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5080
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
747
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.