Click here to Skip to main content
15,898,222 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
sir i have a task i am new to this site can you help me fast

for e.g: i/p:Hello123 ...o/p: as H123


by using Sql functions like


create function function_name
(
)...
as
begin
....
....
end
Go
Posted

Try this link


http://stackoverflow.com/questions/9629880/extract-numbers-from-a-text-in-sql-server[^]

The link above will help you to extract the numbers from your string.
In the final result you will need to add the first character i.e., "H" from your string.

Hope the above solution helps.
 
Share this answer
 
v2
Read this article. It explains clearly about Extracting numbers with SQL Server

and use
SQL
LEFT("Hello123", 1)
or
SQL
SUBSTRING("Hello123", 1, 1)
to extract first letter from your string.Then you can concatenate them to get the desired output.
 
Share this answer
 

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