Video description
Get up and running with accessing SQL Server from PowerShell Core. By the end of this video you’ll have learned how to issue Transact-SQL statements and get results back, how to insert, modify, and delete data in the database, and how to import and export data to and from SQL Server. You’ll be equipped to automate database administration and other maintenance tasks through using PowerShell to automate the execution of Transact-SQL scripts that are stored in files that you can easily edit to keep up with changing business needs.
The video begins by showing where to download PowerShell Core, along with the Visual Studio Code environment that is commonly used as a development platform. Next you’ll learn how to install the module that enables communication between PowerShell and SQL Server. Then the fun begins as you learn how to execute Transact-SQL statements and get results back. A common use case for PowerShell with SQL Server is the importing and exporting of data, and the course concludes with examples showing how to perform imports and exports to and from common file formats, including CSV, JSON, and XML. Also covered is the execution of Transact-SQL scripts stored in text files that you can easily edit, making it easy to keep abreast of changing automation needs.What You Will Learn
- Obtain PowerShell Core and the Visual Studio Code environment
- Install the module needed to access SQL Server from PowerShell Core
- Read data from SQL Server and bring that data back to PowerShell
- Modify, update, and delete data in your database from PowerShell scripts
- Send Transact-SQL scripts stored in text files to SQL Server for execution
- Import and export data to and from CSV, JSON, and XML files
Who This Video Is For
Those familiar with PowerShell who want to use PowerShell as the basis for automating SQL Server maintenance tasks. The video applies to the Windows, Linux, and the macOS platforms.
Table of contents
- Introduction 00:01:12
- PowerShell Core for SQL Server 00:05:15
- The PowerShell Core Environment 00:06:23
- Getting the SQL Server Module 00:12:32
- Executing SQL Commands 00:02:05
- Reading from the Master Database 00:07:28
- PowerShell Splatting 00:05:53
- Creating a Database 00:06:04
- Loading Data into a Database 00:14:02
- Updating the Database 00:08:39
- Issuing SQL Commands Stored in a File 00:06:17
- Exporting Data from SQL Server using PowerShell 00:06:38
- Importing Data to SQL Server using PowerShell 00:07:11
- Wrapping Up 00:02:50
Product information
- Title: PowerShell Core for SQL Server: Automating Your Transact-SQL Scripts
- Author(s):
- Release date: April 2020
- Publisher(s): Apress
- ISBN: 9781484259900
You might also like
book
PowerShell for SQL Server Essentials
Manage and monitor SQL Server administration and application deployment with PowerShell In Detail PowerShell for SQL …
book
Expert Scripting and Automation for SQL Server DBAs
Automate your workload and manage more databases and instances with greater ease and efficiency by combining …
video
Learning Windows PowerShell
In this Learning Windows PowerShell training course, expert author Mark Long will teach you how to …
video
Mastering System Administration with PowerShell 6.x
PowerShell combines command-line speed, the flexibility of scripting, and the power of a GUI-based admin tool. …