0

I am in an odd situation where I cannot connect to the server using python. I can however connect to the server in other ways using SQL Server Management, so from that end I can execute any query. The problem however is parsing in pandas, data retrieved from SQL Manager. As far as I am aware, data from SQL Manager can be retrieved as csv, txt or rpt. Parsing any of these formats is a pain in the neck and it's not always the same for all tables. My question is then, what is the fastest way to parse any of the file formats that SQL Manager can output in pandas? Is there a standard format that SQL Manager can output and which is parsed the same way in pandas for all tables? Has anyone faced this problem, or is there another workaround?

callmeGuy
  • 944
  • 2
  • 11
  • 28
  • I'd love to know why SSMS can connect, but Python can't... anyway, if you export CSV files and try to read them with `pandas.read_csv()`, what happens? (And how is that different than executing a SQL query via `pandas.read_sql()`...) – Evan Nov 12 '18 at 22:22
  • @Evan the reason python can't connect is because it's in a different environment. pandas.read_csv() definitely works and that's the way I've been doing it, however it's pretty annoying because depending on what data I am returning, I always have to parse it differently. pandas.read_sql(), I don't think I can use it as it takes a connection – callmeGuy Nov 12 '18 at 22:44
  • Doesn't seem like anyone else is biting; I guess that using CSVs is the best approach, if you can't get pandas/SQLAlchemy to connect. – Evan Nov 13 '18 at 01:28

0 Answers0