• Hi I see three alternatives depending on your requirements on speed/data-integrity.

    Alternative 1.

    If you are using MSSQL2K then you could create a user defined function to strip leading zeroes. (See BOL on how to create functions.)

    SELECT ...

    FROM TableA a

    LEFT JOIN TableB b on dbo.fn_stripZeroes(a.column) = b.column

    This method will suffer in performance though.

    Alternative 2

    If the leading zeroes are not required then I would suggest to remove them from the database.

    If they are needed by some client you could add them via a view quite easy

    Alternative 3

    If performance is an issue you could create another column in the table which contains the same value as the one you're performing the join on but with the leading zeroes removed.

    This method will however lead to redundace and you will have to make sure that both columns get updated.

    /Fredrik