[dba-SQLServer] Strcomp

Francis Harvey HARVEYF1 at WESTAT.com
Thu May 13 10:22:37 CDT 2004


Martin,

Maybe:

    CASE
        WHEN CONVERT(binary,[tblName.fieldname]) < CONVERT(binary,'Z') THEN
-1
        WHEN CONVERT(binary,[tblName.fieldname]) = CONVERT(binary,'Z') THEN
0
        WHEN CONVERT(binary,[tblName.fieldname]) > CONVERT(binary,'Z') THEN
1
    END

Francis R Harvey III
WB 303, (301)294-3952
harveyf1 at westat.com


> -----Original Message-----
> From: Martin Reid [mailto:mwp.reid at qub.ac.uk] 
> Sent: Wednesday, May 12, 2004 3:35 PM
> To: dba-sqlserver at databaseadvisors.com
> Subject: [dba-SQLServer] Strcomp
> 
> 
> Is there an easy ay to recreate the following in SQL Server
> 
> StrComp([tblName.fieldname],""Z"",0)
> 
> 
> Martin
> _______________________________________________
> 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