Skip to content

MSSQL dialect generates wrong syntax for CAST #9914

Discussion options

You must be logged in to vote

yes make a function that fixes the cast:

def fix_cast(value, type):
    if isinstance(type, String) and type.collation:
        return cast(value, String(type.length)).collate(type.collation)
    else:
        return cast(value, type)

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@zzzeek
Comment options

Answer selected by prudnikov
@prudnikov
Comment options

@CaselIT
Comment options

@zzzeek
Comment options

@gordthompson
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants