Geek Sync I Working with SQL Server for Linux Cross-Platform

How confident are you working with SQL Server on Linux? With this platform becoming increasingly popular it is important for SQL experts to become more knowledgeable for their employers.

Join IDERA and Maximo Trinidad on July 12th as he explores the latest build of SQL Server for Linux, including everything you need to install and connect to SQL Server. He will also look into the tools that are available to use from Linux and / or Windows. Maximo will provide samples on querying for database information using Python/Java and PowerShell between two environments. This will be a demo intensive session you will not want to miss!

You can view Max's slides here.

You can view Max's scripts below.

 

ShareCIFSnotes.txt
sudo mount.cifs //win10ent01/CrossPlatScripts /home/maxt/CrossPlatScripts -o user=maxt


sudo mount.cifs //w2k12Sql01/TempSQLBackups /var/opt/mssql/TempSQLBackups -o user=maxt

sudo umount //win10ent01/CrossPlatScripts


sudo umount //w2k12Sql01/TempSQLBackups

SQLServerInLinux_DemoOutline.txt
Demo Outline:

1. Using you tools
VS Code
SSMS Windows/Linux SQL Server
Create/Mount you folders
Restore Database

2. Python 3.6 (Anaconda)
TestGui01.py
TestGuiRead2Gui.py

3. PowerShell Getting SQL Results:
Execute_nonSMO_sqlqry.ps1
PowerShellCore_SMO_Sample.ps1 

4. Python/PowerShell Integration:
SamplePoweShellPythonSQL3.ps1
Function Out-CsvToGridView.ps1

TestGui01.py
import tkinter
tkinter._test()

TestGuiRead2Gui.py
from tkinter import *
import csv
import sys

## - Prepare GUI envelope:
root = Tk()

## - Open CSV file from folder location:
with open(str(sys.argv[1]), mode='r') as csvfile:
    
    ## - Created Title for GUI application:
    root.title("LittleGridView - " + sys.argv[1])
    
    ## - Loads CSV file:
    csvdata = csv.reader(csvfile, delimiter=',', quotechar='"')

    ## - Reading CSV data from memory:
    for i, rec in enumerate(csvdata, 0):
        col = 0

        ## - For loop for each column(s) found:
        for c in rec:

            ## - Adjust columns default values:
            if col == 0:
                colWidth = 25
            else:
                colWidth = 20
            
            ## - Font Section:
            if i == 0:
                myFg = 'White'
                myBg = 'Black'
            else:
                myFg = 'Black'
                myBg = 'Yellow'

            ## - Build the datagrid:
            Label(root, text=c.replace('"', '').replace('', ''), bg = myBg, fg = myFg, relief=RIDGE, width=colWidth, anchor=W).grid(row=i, column=col)
            col = col + 1
        
        ## - Stop displaying record limited to 20 rows:
        if i == 20:
            #resp = input('Enter Y to Continue: ')
            break

root.mainloop()