I want to write a User-Defined function in SQL SERVER which will take a string as parameter and check it if it has a ‘/’ in the string, it’ll return 1 and otherwise 0.
Please guide me to achieve this scenario.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Unsure why you’d want to make a UDF when TSQL’s
CHARINDEXis all you really need.Try something like this if you really need a UDF:
Use it like this: