Hi, Thanks to all those who replied earlier. I'm still very stuck. (And sorry I wasn't clear the first time.)
I have to use a user defined function to check that a string is correctly formatted. ie. the first character must be a letter and after that they must be numbers. The function returns either 'OK' or 'NotOK'.
I have written this so far (not much)
I am totally in the dark here. can anyone help?
thanks Stephen
warby1212 or "Steve". Way away in Australia
I have to use a user defined function to check that a string is correctly formatted. ie. the first character must be a letter and after that they must be numbers. The function returns either 'OK' or 'NotOK'.
I have written this so far (not much)
Code:
CREATE FUNCTION dbo.CheckForOrderID (@vc1 VARCHAR(50)
)
RETURNS varchar(50) AS
BEGIN
DECLARE @okStatus varchar (50)
SET @okStatus = ''
IF @vc1 = 'O12345'
SET @okStatus = 'OK'
ELSE
SET @okStatus ='Not OK'
RETURN @okStatus
END
I am totally in the dark here. can anyone help?
thanks Stephen
warby1212 or "Steve". Way away in Australia