wintersrd / pipelinewise-tap-mssql

Pipelinewise tap for Microsoft SQL Server
GNU Affero General Public License v3.0
14 stars 50 forks source link

SQL Server with Case Sensitive Collation Error #34

Closed dantwi-cuda closed 1 year ago

dantwi-cuda commented 1 year ago

Hi @wintersrd Thank you for all the great work you've done on this project. I'm using this tap and noticed that all views under INFORMATION_SCHEMA.[TABLES, COLUMNS, CONSTRAINSTS] in SQL Server are are not working when SQL Server is set to case sensitive collation. This is because all column names and view names under INFORMATION_SCHEMA in SQL Server are Upper case by default. Which means the following line

  """SELECT table_schema,
                table_name,
                table_type
            FROM INFORMATION_SCHEMA.tables c" 

and other instances of Queries on the INFORMATION_SCHEMA view in INIT.py will always error out when SQL Server collation is case sensitive. I believe the fix might be to change "tables" in the query above to "TABLES" so that it works irrespective of the collation. There are other queries as well which will need the view name and column names to also change to upper case. Attached is the modified INIT.py file init.txt

wesseljt commented 1 year ago

@dantwi-cuda I experienced this issue as well. Could you submit a PR here?