Please remember to thank our sponsors!

Slides:



Advertisements
Similar presentations
Connecting to Databases. connecting to DB DB server typically a standalone application Server runs on localhost for smaller sites –i.e. Same machine as.
Advertisements

Connecting to Databases. relational databases tables and relations accessed using SQL database -specific functionality –transaction processing commit.
PHP SQL. Connection code:- mysql_connect("server", "username", "password"); Connect to the Database Server with the authorised user and password. Eg $connect.
Programming MySQL, Perl COEN 351. Reading List Paul DuBois: MySQL and Perl for the Web, New Riders, 2002 Jacqueline D. Hamilton: CGI Programming 101,
NEVUG - August 2004 To Boldly Go: Using Perl and the Perl DBI as an Adjunct to MS Access for Custom Reports Maggie Rioux MBLWHOI Library Woods Hole, Mass.
Murali Mani SQL-PL Interface. Murali Mani Some Possible Options Web Interface Perl /CGI with Oracle/mySQL Install your own web server and use servlets.
Creating WordPress Websites. Creating a site on your computer Local server Local WordPress installation Setting Up Dreamweaver.
PHP Scripting Language. Introduction “PHP” is an acronym for “PHP: Hypertext Preprocessor.” It is an interpreted, server-side scripting language. Originally.
AGENDA Tools used in SQL Server 2000 Graphical BOL Enterprise Manager Service Manager CLI Query Analyzer OSQL BCP.
Setting Up a Development Server Once you have your own development server, you’ll wonder how you ever managed without one, and it’s easy to set one up!
1 Open Source Programming. -Introduction to PHP -PHP installation /wamp server installation for PHP environment -PHP syntax -PHP variables -PHP Strings.
Phil Brewster  One of the first steps – identify the proper data types  Decide how data (in columns) should be stored and used.
1 Working with MS SQL Server II. 2 The sqlcmd Utility Command line utility for MS SQL Server databases. Previous version called osql Available on classroom.
1 Chapter Overview Reviewing the Results of Installation Starting, Stopping, Pausing, and Modifying Microsoft SQL Server 2000 Services Working with Osql,
SJSU CS157B Dr. Lee1  2004 Jenny Mitchell Two Useful Tools You Can’t Live Without by Jenny Mitchell SJSU CS157B Section PHP and MySQL.
Monitoring Scale-Out with the MySQL Enterprise Monitor Andy Bang Lead Software Engineer MySQL-Sun, Enterprise Tools Team Wednesday, April 16, :15.
1 Working with MS SQL Server. 2 Objectives You will be able to Use Visual Studio for GUI based interactive access to a Microsoft SQL Server database.
Session 5: Working with MySQL iNET Academy Open Source Web Development.
7/8/05MySQL David Lawrence1 David Lawrence, JLab An introduction for the novice.
1 Chapter 8 – Working with Databases spring into PHP 5 by Steven Holzner Slides were developed by Jack Davis College of Information Science and Technology.
Chapter 7 PHP Interacts with Ms. Access (Open DataBase Connectivity (ODBC))
PHP Data Object (PDO) Khaled Al-Sham’aa. What is PDO? PDO is a PHP extension to formalise PHP's database connections by creating a uniform interface.
Sayed Ahmed Computer Engineering, BUET, Bangladesh MSC, Computer Science, U of Manitoba, Canada
MOODLE and Other Database Integration ผศ. ดร. เด่นพงษ์ สุดภักดี ผู้ช่วยอธิการบดีฝ่ายวิชาการ และ ผู้อำนวยการสำนักนวัตกรรมการเรียนการสอน มหาวิทยาลัยขอนแก่น.
DB Libraries: An Alternative to DBMS By Matt Stegman November 22, 2005.
DBI tutorial February 5 th, What is DBI DBI is short for Database Interface, which is a Perl module DBI is short for Database Interface, which is.
Python MySQL Database Access
Installing and Using MySQL and phpMyAdmin. Last Time... Installing Apache server Installing PHP Running basic PHP scripts on the server Not necessary.
(Chapter 10 continued) Our examples feature MySQL as the database engine. It's open source and free. It's fully featured. And it's platform independent.
Reactive Database Access in Scala with Slick 3
1 Chapter Overview Preparing to Upgrade Performing a Version Upgrade from Microsoft SQL Server 7.0 Performing an Online Database Upgrade from SQL Server.
Introduction to MySQL MySQL Overview by Ray Williams CS 320/565 Marymount University.
PHP Database connectivity Connecting with RDBMS and editing, adding, and deleting databases therein are all done through PHP functions.
Web Server Administration Chapter 7 Installing and Testing a Programming Environment.
PHP and Mysql Database. PHP and Database Mysql – popular open-source database management system PHP usually works with Mysql for web-based database applications.
PHP Workshop ‹#› PHP Data Object (PDO). PHP Workshop ‹#› What is PDO? PDO is a PHP extension to formalise PHP's database connections by creating a uniform.
Copyright 2007 Byrne Reese. Distributed under Creative Commons, share and share alike with attribution. Intermediate Perl Programming Class Four Instructor:
Copyright 2007 Byrne Reese. Distributed under Creative Commons, share and share alike with attribution. Intermediate Perl Programming Class Three Instructor:
PHP Introduction PHP is a server-side scripting language.
CP476 Internet Computing Perl CGI and MySql 1 Relational Databases –A database is a collection of data organized to allow relatively easy access for retrievals,
Using SQL for Patron Card Expiration Reminders For Norcal IUG – Nov. 20, 2015 At the Berkeley Public Library.
DBI: The Neophyte's Guide1 What is DBI? DBI = DataBase Interface DBI is database-independent DBI allows you to write code that interacts with databases.
SQL Query Analyzer. Graphical tool that allows you to:  Create queries and other SQL scripts and execute them against SQL Server databases. (Query window)
SQL pepper. Why SQL File I/O is a great deal of code Optimal file organization and indexing is critical and a great deal of code and theory implementation.
Introduction to SQL Server  Working with MS SQL Server and SQL Server Management Studio.
CMPE 226 Database Systems April 19 Class Meeting Department of Computer Engineering San Jose State University Spring 2016 Instructor: Ron Mak
Programming for the Web MySQL Command Line Using PHP with MySQL Dónal Mulligan BSc MA
PHP stands for …….. “PHP Hypertext Pre-processor” and is a server-side scripting language like ASP. PHP scripts are executed on the server PHP supports.
FUN WITH AVAILABILITY GROUPS Christopher Wolff SQL Server Database Engineer, Xero.
COM621: Advanced Interactive Web Development Lecture 10 PHP and MySQL.
Microsoft Connect /23/ :39 PM
SQL Server on Linux CTP 1.1 Florian
How to tune your applications before moving your database to Microsoft Azure SQL Database (MASD) OK, you've jumped into your Azure journey by creating.
Data Virtualization Demoette… ODBC Clients
Introduction to Dynamic Web Programming
Working with SQL Server for Linux Cross-Platform
Become a Bilingual DBA Oracle for the SQL Server DBA
Lead SQL BankofAmerica Blog: SQLHarry.com
Principles of Software Development
SQL Server + PHP: What’s New
Microsoft Connect /2/2018 2:41 PM
PHP / MySQL Introduction
Using PowerShell with Python & SQL Server
Perl Database – Just Enough
Tutorial 6 PHP & MySQL Li Xu
CS3220 Web and Internet Programming SQL and MySQL
Introduction to PHP.
CS3220 Web and Internet Programming SQL and MySQL
Managing and monitoring SQL Server on Linux from the command line
Web Application Development Using PHP
Presentation transcript:

Please remember to thank our sponsors! All these awesome sponsors! Visit the vendors Thank them if you can!

MSSQL is Coming to Linux Are You Ready? Nem W. Schlecht

MSSQL is coming to Linux!! LAMP= Big things are coming! MSSQL is coming to Linux!! LAMP= Linux Apache MySQL/MariaDB/MSSQL PHP/Perl/Python Big news! Microsoft usually doesn’t like support non-Microsoft operating systems

So what??? Completely free MSSQL SQL Express Linux VirtualBox Windows Server 2012 (eval) VirtualBox + Puppet/Ancible = quick dev environments

Some questions… What won’t be there? Clustering Access to registry values SSMS (on Linux) Too reliant on underlying windows OS VisualStudio on Linux IS a possibility!

Most things should work Some answers Easy install apt-get install mssql-server Most things should work Replication Mirroring HA Backups Linux has *much* better underlying filesystems

Just the database engine Some answers Just the database engine No Reporting Services No Analysis Services For now…

Sign up for notifications on MSSQL on Linux Sign up today! Sign up for notifications on MSSQL on Linux https://www.microsoft.com/en-us/cloud-platform/sql-server-on-linux http://bit.ly/linuxmssql

What about now? What can we do now? Port applications to MSSQL Access MSSQL from Linux

Use linked servers on MSSQL FreeTDS library on Linux First steps Use linked servers on MSSQL Connect to Linux databases FreeTDS library on Linux Yes! You can access MSSQL from Linux already!

Connect to any DB with an ODBC connector Linked Servers Connect to any DB with an ODBC connector MySQL PostgreSQL SQLite

Link to external database Linked Servers Link to external database Install DB OBCD driver Connect to DB Add Linked Server Query away

Linked Servers OPENQUERY() Query external database

Linked Servers - SELECT FROM OPENQUERY(MySQLdb, ' SELECT id , name , age , address , active FROM users WHERE active = "y" ');

Linked Servers - INSERT (What?) INSERT INTO OPENQUERY(MySQLdb, ' SELECT id , name , age , address FROM users WHERE 1=0 ') VALUES ( 'nem' , 41 , '123 Town Street, Anycity USA, 12345' );

Linked Servers - UPDATE OPENQUERY(MySQLdb, ' SELECT id , name , age , address FROM users WHERE name = "nem" ') SET age = 41;

Linked Servers - DELETE OPENQUERY(MySQLdb, ' SELECT id , name , age , address FROM users ') WHERE name = ‘nem’ ;

Linked Servers - Copy Table SELECT name , age , address , active INTO users FROM OPENQUERY(MySQLdb, ' SELECT id , name , age , address FROM users ');

Linked Servers - Fun Stuff Join a MySQL table to an SQLite table Connect to a MySQL database over an SSH tunnel Use VIEWs to simplify OPENQUERY

Linked Servers - Demo Demo

FreeTDS library Connect to MSSQL Servers from Linux (and Mac) Use: PHP Perl Python Ruby Command Line Utilities Bash Scripts

FreeTDS Configuration /etc/freetds/freetds.conf [global] tds version = auto text size = 64512 client charset = UTF-8 [localdb] host = localhost instance = MSSQLSERVER port = 1433 tds version = 8.0

FreeTDS Configuration (multiple names) [localdb] host = localhost instance = MSSQLSERVER port = 1433 tds version = 8.0 [appdevdb]

FreeTDS Configuration Instance [appqadb] host = localhost instance = APPQA port = 14331 tds version = 8.0

FreeTDS Utilities tsql defncopy datacopy Test SQL connection, but can run any SQL defncopy Print out CREATE statement for SQL object datacopy Copy data between servers

FreeTDS Utilities freebcp fisql osql bcp clone Interactive SQL shell OSQL clone (uses ODBC)

FreeTDS Utilities Demos

FreeTDS Library Uses existing language database API

FreeTDS Library API (Perl) #!/usr/bin/perl use DBI; $db = "nemdev"; my $dbh = DBI->connect("dbi:Sybase:$db" , "$ENV{DBI_USER}" , "$ENV{DBI_PASS}") || die "No DB Connect"; $dbh->do("USE tempdb"); $dbh->do("DROP TABLE test_table"); $dbh->do("CREATE TABLE test_table (test_field VARCHAR(10))");

FreeTDS Library API (Perl cont.) my $sth = $dbh->prepare(" INSERT INTO test_table (test_field) VALUES (?) "); my(@insdata)=qw(this is just some text); for (@insdata) { $sth->execute($_); } $sth->finish();

FreeTDS Library API (cont.) $sth = $dbh->prepare(" SELECT test_field FROM test_table ORDER BY test_field "); $sth->execute(); while (my @row = $sth->fetchrow()) { print "Row data: @row\n"; } $sth->finish(); $dbh->disconnect();

FreeTDS Library API (PHP) <?php $link = mssql_connect('nemdev', 'nem', 'S3cr3t!'); if (!$link) die('Unable to connect!'); if (!mssql_select_db(tempdb', $link)) die('Unable to select database!'); $result = mssql_query('SELECT test_field FROM test_table'); while ($row = mssql_fetch_array($result)) { var_dump($row); } mssql_free_result($result); ?>

Questions? Wake Up!

Contact Info Nem W. Schlecht Email: nemws1@gmail.com Twitter: @nemws1 PASS Fargo Chapter sqlpass.org – search for "Fargo“ http://sqlfargo.sqlpass.org/