Problem:
Limit the value of a VARCHAR
variable (or a column) to digits and ASCI characters, but allow variable length.
This script will not yield required result:
declare @var as VARCHAR (150)
select @var = '123ABC'
if (@var LIKE '[a-zA-Z0-9]{0,150}')
print 'OK'
else
print 'Not OK'
Anyone have idea how to do this?