Validate a string in a table in SQL Server
Posted
by Ashish Gupta
on Stack Overflow
See other posts from Stack Overflow
or by Ashish Gupta
Published on 2010-03-13T07:08:19Z
Indexed on
2010/03/13
7:15 UTC
Read the original article
Hit count: 328
sql-server
I need to check If a column value (string) in SQL server table starts with a small letter and can only contain '_', '-', numbers and alphabets. I know I can use a SQL server CLR function for that. However, I am trying to implement that validation using a scalar UDF and could make very little here...I can use 'NOT LIKE', but I am not sure how to make sure I validate the string irrespective of the order of characters or in other words write a pattern in SQL for this. Am I better off using a SQL CLR function? Any help will be appreciated..
Thanks in advance
© Stack Overflow or respective owner