until sql comes out with try-catch (which I understand they will), you have to anticipate what could raise an error and test for your condition before making the attempt. For your particular example, I wrote a udf (a long time ago - so be kind people) that I use to test a single value before I try to use at as a uniqueidentifier: (this is designed to work on a single value rather than be used in a select list)If Object_ID('dbo.fnIsGuid') > 0 Drop Function dbo.fnIsGuidGOCreate Function dbo.fnIsGuid(@Guid varChar(128)) returns bitasBegin --Guid format: '22D6CE78-8DBF-426D-8911-337A7277665D' declare @i tinyint --if first and last characters are curly braces --get rid of them set @Guid = replace(replace(@Guid, '{', ''), '}', '') --uniqueidentifier converts to char(36) if len(isNull(@Guid,'')) <> 36 return 0 set @i = 1 while @i < 37 Begin if @i IN (9,14,19,24) Begin if subString(@Guid, @i, 1) <> '-' return 0 End else if charindex(subString(@Guid, @i, 1), '0123456789ABCDEF') = 0 return 0 set @i = @i + 1 End return 1EndBe One with the OptimizerTG