PowerShell Core for SQL Server: Automating Your Transact-SQL Scripts

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. 

 



Product information

  • Title: PowerShell Core for SQL Server: Automating Your Transact-SQL Scripts
  • Author(s): Robert C. Cain
  • Release date: April 2020
  • Publisher(s): Apress
  • ISBN: 9781484259900