livehelpnow / tds_ecto

TDS Adapter for Ecto
57 stars 34 forks source link

Error with set_transaction_isolation_level: :read_uncommited #72

Closed ksherman closed 5 years ago

ksherman commented 5 years ago

Hiyya! Our DBA puts a lot of WITH (NOLOCK) on his queries and I'm trying to accomplish something similar in the Ecto queries.

It is my understanding that READ UNCOMMITTED is sorta the same thing, and it seems we can set this at the config level with tds_ecto? I've tried setting set_transaction_isolation_level: :read_uncommited in config but I get

[error] Tds.Protocol (#PID<0.1176.0>) failed to connect: ** (Tds.Error) Line 1 (Error 102): Incorrect syntax near 'UNCOMMITED'.

Not sure whassup. My guess here is maybe the atom should be :read_uncommitted as READ UNCOMMITTED should have two T's? https://docs.microsoft.com/en-us/sql/t-sql/statements/set-transaction-isolation-level-transact-sql?view=sql-server-2017

ksherman commented 5 years ago

(Sorry if this should be an issue over one the TDS repo, happy to close and move over there)

mjaric commented 5 years ago

Thanks for reporting, should be fixed now in tds v1.1.7