Please start any new threads on our new site at http://forums.sqlteam.com. 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
 
Register Now and get your question answered!
Username:
Password:
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  

sqlps
Starting Member

India
8 Posts

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

Hi,


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

madhivanan
Premature Yak Congratulator

India
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


Madhivanan

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

visakh16
Very Important crosS Applying yaK Herder

India
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

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
  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.03 seconds. Powered By: Snitz Forums 2000