Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE FUNCTION ufn_IsWordComprised (@setOfLetters VARCHAR(20), @word VARCHAR(20))
- RETURNS BIT
- AS
- BEGIN
- IF (SUBSTRING(@word,1,1) LIKE '[' + @setOfLetters + ']')
- BEGIN
- SET @word = SUBSTRING(@word,2,LEN(@word)-1)
- RETURN dbo.ufn_IsWordComprised (@setOfLetters,@word)
- END
- IF (LEN(@word) = 0)
- RETURN 1
- RETURN 0
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement