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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 How to check a varchar data is uniqueidentifier or
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

8 Posts

Posted - 10/31/2013 :  03:02:01  Show Profile  Reply with Quote


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

Premature Yak Congratulator

22864 Posts

Posted - 10/31/2013 :  03:08:16  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote

WHERE try_convert(uniqueidentifier ,varchar_col) is not null


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

Very Important crosS Applying yaK Herder

52326 Posts

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

SQL Server MVP
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000