Link to home
Start Free TrialLog in
Avatar of skij
skijFlag for Canada

asked on

MS SQL: Create User Function to Remove Long Words

I want a user function that will remove all words longer than 7 characters.

For example:
Select dbo.RemoveLongWords('Hello Supercalifragilisticexpialidocious 01234567890 World 123 @#$!@# pneumonoultramicroscopicsilicovolcanoconiosis')

Open in new window

Should return:

Hello World 123 @#$!@#

ALTER Function [dbo].[RemoveLongWords](@Temp NVarChar(MAX))
Returns NVarChar(MAX)
AS
Begin

...???...

End

Open in new window

Avatar of chaau
chaau
Flag of Australia image

Is it a homework?
Avatar of skij

ASKER

@chaau: I've been working longer than you have been living :-)  It is not homework.
I don't care, in fact, I don't care at all. Good luck with your life with such attitude
ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of skij

ASKER

This works perfectly, thanks!