October 29, 2013 at 2:45 am
Hi All,
I tried to find relevant thread but did not find anything that answers my question. Appreciate if one of you can help me out either direct me to the thread or help me in finding the solution.
I have a table from which I need to extract all special characters being used in a column.
I tried with Tally table concepts and also tried with regex, but regex is not a feasible solution as I need all special characters being used in column.
October 29, 2013 at 2:52 am
What are these special characters?
Can you give some sample data and desired output?
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
October 29, 2013 at 2:57 am
Thanks for your prompt reply..
I have a column UserID in USer table which accepts all characters.
I have to Identify all special characters that are already present in production db in User_ID column and list them out.
For Instance :
SELECT USER_ID FROM dbo.USERS WHERE USERID = 'testUser$'
The desired output should be : $
but this I need to make generic..
October 29, 2013 at 3:05 am
Do you store a list somewhere that defines all the special characters?
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
October 29, 2013 at 3:14 am
No.
Let me correct to get it more clear..
SELECT USER_ID FROM dbo.USERS WHERE USERID = 'testUser$'
User Table :
ID USer_ID CreatedDate
1 'test123$' 2013-10-29 14:38:54.947
2 'test!234' 2013-10-29 14:38:54.947
3 'test€123' 2013-10-29 14:38:54.947
the output should be :
$
!
€
i.e. all special characters those are used in User_Id should be listed
October 29, 2013 at 3:16 am
I'll rephrase my question:
How do you define what is a special character and what not?
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
October 29, 2013 at 3:21 am
We are currently referring extended ASCII codes (character code 128-255) as extended special characters, in short all characters except [a-z A-Z 0-9] we r treating them as special characters
October 29, 2013 at 3:41 am
This post has a solution:
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
October 29, 2013 at 4:17 am
Thanks..
🙂 Seems it will solve my problem..
October 29, 2013 at 5:18 am
Thank you Koen..
It worked for me..
Viewing 10 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply