Hi,

I'm trying to issue a query in SQL Server via select(cols, cond, ...) and I 
would like to add collation at query execution time for executing the query 
in a case sensitive mode.
I tried this:

cond = and_(tab.c.col3=="mystring1", tab.c.col2=="mystring2")
cond = cond.collate("SQL_Latin1_General_CP1_CS_AS")
q = select([tab.c.col3, tab.c.col4], cond, ...)
...

But that is raising a syntax error.

(SQLExecDirectW); [42000] [Microsoft][ODBC SQL Server Driver][SQL 
Server]Incorrect syntax near 'COLLATE'. (102); [42000] [SQL: u'SELECT 
tab.col3, tab.col4 \nFROM tab \nWHERE (tab.col1 = ? AND tab.col2 = ?) 
COLLATE SQL_Latin1_General_CP1_CS_AS'] [parameters: (u'mystring1', 
u'mystring2')] (Background on this error at: http://sqlalche.me/e/f405)


 Can anyone help me on how to achieve this?

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/5db87be0-bb3e-400b-b1c6-6a49bdf20c7c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to