Camillia
asked on
How to know if a string is GUID?
I have a sql statement that joins to 2 tables and brings back an ID row. I changed the design and the new IDs are integers. The old IDs are GUIDs.
How can I know if the ID is GUID and not an integer? based on that, i want to use an if-else statement.
thanks
How can I know if the ID is GUID and not an integer? based on that, i want to use an if-else statement.
thanks
ASKER
want to do it in C#, ASP.net. But let me look at your link
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Why not use Guid.Tryparse?
ASKER
so if (Guid.Tryparse(field) = true)
?
?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://ask.sqlservercentral.com/questions/23114/best-way-to-check-that-a-stringvarchar-guid-is-val.html