A customer needs to know whether the names of the users contain some invalid characters, like tab characters. This is the code of a function which validates a string in sql: CREATE FUNCTION IsNameValid( @Name NVARCHAR(100) )
RETURNS BIT
BEGIN
SELECT @Name = RTRIM(ltrim(@Name))
IF(@name IS null) OR (@Name = '')
RETURN 1
DECLARE @len AS INT
DECLARE @index AS INT
DECLARE @ascii AS int
SELECT @len = LEN(@Name),@index = 1
...