moondaddy
2008-11-28 21:46:50 UTC
Using sql 08 I need to convert a string to a uniqueidentifer which is
failing. Please advise how I can do this convertion. Thanks.
DECLARE
@id uniqueidentifier,
@str varchar;
-- I tried both guids below and both failed.
--SET @str = '0be3cf11-7daf-4f61-bca2-9797293a79f4' --this was created in
.net
SET @str = 'de8dcc34-a07f-4fb5-a430-b92733adc725' --this was created in sql
using newid()
SET @id = CONVERT(UNIQUEIDENTIFIER, @str);
select @id
and this code returns this error msg:
Conversion failed when converting from a character string to
uniqueidentifier.
failing. Please advise how I can do this convertion. Thanks.
DECLARE
@id uniqueidentifier,
@str varchar;
-- I tried both guids below and both failed.
--SET @str = '0be3cf11-7daf-4f61-bca2-9797293a79f4' --this was created in
.net
SET @str = 'de8dcc34-a07f-4fb5-a430-b92733adc725' --this was created in sql
using newid()
SET @id = CONVERT(UNIQUEIDENTIFIER, @str);
select @id
and this code returns this error msg:
Conversion failed when converting from a character string to
uniqueidentifier.
--
***@newsgroup.nospam
***@newsgroup.nospam