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 2008 Forums
 Transact-SQL (2008)
 How to check a varchar data is uniqueidentifier or

Author  Topic 

sqlps
Starting Member

8 Posts

Posted - 2013-10-31 : 03:02:01

Hi,


Is there any method to check a varchar data is uniqueidentifier or not?

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2013-10-31 : 03:08:16

WHERE try_convert(uniqueidentifier ,varchar_col) is not null


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-10-31 : 04:02:45
try_convert is available only from sql 2012 onwards
so if you're on an earlier version use

http://weblogs.sqlteam.com/mladenp/archive/2005/08/16/7545.aspx

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -