[dba-SQLServer]strComp

Nicholson, Karen knicholson at gpsx.net
Mon Aug 18 07:53:13 CDT 2003


Or, this works:

IF Convert(binary,'TEST') = Convert(binary,'TEST')
PRINT 'Match'
ELSE
PRINT 'No Match'


-----Original Message-----
From: Stuart McLachlan [mailto:stuart at lexacorp.com.pg]
Sent: Monday, August 18, 2003 7:46 AM
To: dba-sqlserver at databaseadvisors.com
Subject: Re: [dba-SQLServer]strComp


On 18 Aug 2003 at 9:53, Martin Reid wrote:

> Anyone know of a similar function for use with SQL Server? Seems to coke
on
> strComp
> 
> 

I think you need to roll your own. Something like this (air code, so 
may need a bit of tweaking)

Select 'strComp'  = 
    Case 
          When (String1 Is Null)  or (String2 Is Null) Then Null
		When String1 < String2 Then -1
           When String1 = String2 Then 0
           When String 1 > String2 Then 1
    End
 
-- 
Lexacorp Ltd
http://www.lexacorp.com.pg
Information Technology Consultancy, Software Development,System 
Support.



_______________________________________________
dba-SQLServer mailing list
dba-SQLServer at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
http://www.databaseadvisors.com


More information about the dba-SQLServer mailing list