create table #guid_values ( guid_str varchar(36) )
insert #guid_values values ( 'BC1EAAAF-1B5A-4695-9797-3ED6C99B7FC5' )
insert #guid_values values ( 'BCXXAAAF-1B5A-4695-9797-3EDXXXXXXFC5' )
insert #guid_values values ( '-jk1029347 lka llur 193241 lk;qed' )
go
select guid_str,
        case when guid_str
                like replicate('[0-9a-fA-F]', 8) + '-' +
                        replicate('[0-9a-fA-F]', 4) + '-' +
                        replicate('[0-9a-fA-F]', 4) + '-' +
                        replicate('[0-9a-fA-F]', 4) + '-' +
                        replicate('[0-9a-fA-F]', 12)
                then 'Yes'
                else 'No'
        end AS ISGUID
from #guid_values
This page was last updated on May 01, 2006 04:28 PM.