Presentation is loading. Please wait.

Presentation is loading. Please wait.

Working with SQL Server for Linux Cross-Platform

Similar presentations


Presentation on theme: "Working with SQL Server for Linux Cross-Platform"— Presentation transcript:

1 Working with SQL Server for Linux Cross-Platform
August 23, 2017 Maximo Trinidad

2

3 Agenda 1 2 3 4 5 Understanding Your Environment
PowerShell and SQL Server 3 Python SQL Connectors 4 Questions 5 Reference Information

4 Understanding Your Environment

5 Top demand programming languages
3 SQL Java Python Javascript C++ C# Perl iOS PHP

6 Understanding Your Environment
4 Understanding Your Environment - Install component in both Windows and Linux - PowerShell Open Source - In Linux and Windows use Anaconda Python 3.6 - Anaconda include - Python Tcl/Tk & SQL Connectors - Use OneDrive - On Bash access (/mnt/c/Users/#username#/OneDrive) - On Linux access Windows shared folders

7 Understanding Your Environment
5 Understanding Your Environment - You're New to Linux - Get “Ubuntu” from Microsoft Store - Install "Ubuntu Desktop" - PowerShell - Python - Cross-Platform Editor - VS Code lightweight Multi-language editor - Other editors -Sublime -Brains PyCharm (Robust Python Editor Windows and Linux) *Use Windows Editors to create code

8 6 Windows 10

9 Understanding Your Environment
5 Understanding Your Environment - SQL Server 2017 on Linux - Version RC2 - Production Ready - SQL Agent Available - ODBC Connector available - Azure SQL ready - Use VS Code mssql extension No PowerShell Commands available Use PowerShell Core with either: SMO (availability coming soon –only works with Beta 2) Use non-SMO .Net System.Data

10 PowerShell and SQL Server
7 PowerShell and SQL Server - SQL Server PowerShell scripting - In Windows: (Windows PowerShell) - Two PS Modules available: SQLPS, SQLServer (2017) - Using SMO - In Linux, PowerShell Core using only SMO - In Windows, PowerShell Core SMO **not ready** - Python with PowerShell (for data collection, and Tasks automation) - Possibility of Cross-platform solutions - Take advantage of .NET objects in Linux

11 PowerShell and SQL Server
8 PowerShell and SQL Server

12 PowerShell and SQL Server
9 PowerShell and SQL Server

13 Connecting to SQL Server with Python
10 Connecting to SQL Server with Python Choose a Python version Use “sudo su; Update-Alternatives” command update-alternatives --list python - Two SQL Connectors - pyodbc - pymssql (not covered) - Connectors Behavior - pyodbc and pymssql can connect to - Windows local and Multi-instance SQLServer - Linux only single instance

14 11 Demo 1. Using you tools VS Code, PoweShell Core, Anaconda Python 3.6.x SSMS – Windows & Linux connectivity (** SQL Authentication only **) Mounting Shared folders Restore Database 2. Python 3.6 (Anaconda)* TestGuiRead2Gui.py TestSqlGui.py *Note: dos2unix –k *.* (text code converter win2linux format) 3. PowerShell Getting SQL Results Execute_nonSMO_sqlqry.ps1 PowerShellCore_SMO_Sample.ps1 4. Python/PowerShell Integration: SamplePoweShellPythonSQL3_nogui.ps1 Function Out-CsvToGridView.ps1

15 Reference Information
13 Reference Information PowerShell Open Source: Windows PowerShell bugs use UserVoice: Python SQL Server ODBC connector (pyodbc): Python Microsoft SQL Server connector (pymssql): Bash for Windows 10: Python 3.6 Anaconda in SQL Server 2017: Microsoft blog - MVP Award program Blog:

16 12 Questions

17 Contact information: Maximo Trinidad Blog:


Download ppt "Working with SQL Server for Linux Cross-Platform"

Similar presentations


Ads by Google