How to Query Microsoft SQL Server from Linux
In a perfect system administrator’s world, everything would be the same. All servers would be identical, run the same workloads on the same configurations and perform equally. If only wishing made it so. System administrators must manage a heterogeneous environment full of different OS flavors, configurations and so on. This couldn’t be more evident in the need to perform SQL queries from a Linux machine.
Read on to find out one way that will allow you to perform any number of T-SQL queries to a SQL Server machine. I’ll be using Ubuntu 16.04, and I will be querying a SQL Server 2012 R2 machine. However, the same technique should apply to other Linux flavors and SQL Server versions.
To get started, we’re going to need to install a few prerequisites. We’re going to be querying SQL Server from Python, so we’ll need a prerequisites Python module called PyODBC. This module allows you to query any number of ODBC databases. To get this installed, we’ll use pip (the Python package manager)…
Read the full article at TomsITPro.
Latest posts by Adam Bertram (see all)
- How to Create a Microsoft DHCP Lease Inventory Script - January 30, 2017
- An introduction to infrastructure testing with PowerShell Pester - January 27, 2017
- List installed programs on remote computers with PowerShell - January 27, 2017