I have been through our database and we have a culprit who has been inputting all names in full capitals which I have always found particularly annoying. I want to convert them all to proper case for which I found the code below. However how can I detect the set where they have inproper case.CREATE FUNCTION dbo.pCase ( @strIn VARCHAR(255) ) RETURNS VARCHAR(255) AS BEGIN IF @strIn IS NULL RETURN NULL DECLARE @strOut VARCHAR(255), @i INT, @Up BIT, @c VARCHAR(2) SELECT @strOut = '', @i = 0, @Up = 1 WHILE @i <= DATALENGTH(@strIn) BEGIN SET @c = SUBSTRING(@strIn,@i,1) IF @c IN (' ','-','''') BEGIN SET @strOut = @strOut + @c SET @Up = 1 END ELSE BEGIN IF @up = 1 SET @c = UPPER(@c) ELSE SET @c = LOWER(@c) SET @strOut = @strOut + @c SET @Up = 0 END SET @i = @i + 1 END RETURN @strOut END GO