Click here to Skip to main content
15,890,399 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Column has inserted with numbers,some of the records having numbering and some of not have.
but i want to be remove numbering those have records.
please find below my scenario in column 2
Ex:
Column2
Thank you for your participation in the recent Women’s Health Training Program. While the program is still fresh in your mind, we would like you to complete a survey.
1. Please select the following reason(s) for attending this course:
Please provide comments if above question is answered as ‘Other’
2. Did this course meet your educational needs?
Please provide comments if needed
3. The information presented reinforced and/ or improved my current skills:
4. As a learner, I found the teaching method(s) effective:
6. As a result of participating in this course, will you make any measureable changes to your practice?
7. These educational offerings have increased, improved, or positively impacted my:
9. What did you find to be the highlight(s) of this program?
Please enter your contact information if you are in interested hearing more from Hologic.
11. Please provide any additional feedback or suggestions for future courses/course topics in the space below

What I have tried:

I have used stuff function, but those not have number that records also affected.
Posted
Updated 12-Mar-16 4:28am
Comments
OriginalGriff 12-Mar-16 3:31am    
Stop reposting the same question just because you haven't had an answer instantly. Particularly if they are just a copy'n'paste of this one.
It doesn't get you an answer any faster, and that kind of rudeness can delay a response - I for one will not be even looking at the question.
I have deleted all the spare ones.

1 solution

Just do the update on rows
SQL
where column2 like '[0-9]%'


[Edit - OP has attempted to clarify what they meant]

Try something like
SQL
select dbo.RemoveNonAlphaCharacters(column2) from ex

where you have a function like this
SQL
create Function [dbo].[RemoveNonAlphaCharacters](@Temp VarChar(1000))
Returns VarChar(1000)
AS
Begin

    Declare @KeepValues as varchar(50)
    Set @KeepValues = '%[^a-z ]%'
    While PatIndex(@KeepValues, @Temp) > 0
        Set @Temp = Stuff(@Temp, PatIndex(@KeepValues, @Temp), 1, '')

    Return @Temp
End
which I adapted from the solution by G Mastros on this post[^]
 
Share this answer
 
v2
Comments
Member 10645463 13-Mar-16 0:16am    
yes the solution is correct, but i do not want update any tables. i am doing reports, i want display the records. even i have tried the solution, its coming only those have number, the doesn't come those not have and vice versa.
CHill60 13-Mar-16 15:25pm    
I have updated my solution with a more complete answer - it would have helped if you had not said that you wanted to "remove" the numbering.
Member 10645463 6-Apr-16 7:25am    
Thank so much. sorry for my response delayed

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900