def mssql_encode(t):
 return ('CHAR(%s)' % ')+CHAR('.join((str(ord(c)) for c in t)))

def mssql_encode ( t ) : return ( 'CHAR(%s)' % ')+CHAR(' . join ( ( str ( ord ( c ) ) for c in t ) ) )
convert the text to a char-like ms sql command .