SQL Server Forums
Profile | Register | 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
 New Topic  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
22754 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
52317 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  
 New 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.05 seconds. Powered By: Snitz Forums 2000