Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Uniqueidentifiers

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-12-11 : 07:56:37
manjiri writes "i want to show Uniqueidentifier generated by SQL in tha label
but it is giving me an error that is "Cast from GUID to string is invalid". What should i do now? "

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2006-12-11 : 08:02:36
guid.ToString() ??



Go with the flow & have fun! Else fight the flow
blog thingie: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-12-11 : 08:14:11
[]In SQL Server, you do as this[/b]
select cast(newid() as varchar(36))

What language are you using?


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2006-12-11 : 08:16:45
Casting to string? which specific data type? where?

This works on my box:

declare @u uniqueidentifier

set @u = newid()

select cast(@u as varchar(100))


Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page
   

- Advertisement -