1
0
mirror of https://github.com/Microsoft/sql-server-samples.git synced 2025-12-08 14:58:54 +00:00
Files
sql-server-samples/samples/features/data-migration-assistant/PowerShell Script
2017-08-31 12:05:42 -07:00
..
2017-08-31 12:05:42 -07:00

PowerShell Script for Importing Assessment Results

This contains a PowerShell script for importing assessment results from JSON files into a SQL Server database. Assessments are generated using Data Migration Assistant, to evaluate moving data to SQL Server or to Azure SQL Database.

Contents

About this sample
Before you begin
Run this sample
Sample details
Disclaimers
Related links

About this sample

  • Applies to: SQL Server 2016 (or higher), Azure SQL Database
  • Key features: Migration assessments
  • Programming Language: PowerShell
  • Authors: Chris Lound

Before you begin

To run this sample, you need the following prerequisites.

Software prerequisites:

  1. PowerShell
  2. SQL Server 2016 (or higher) or an Azure SQL Database
  3. Data Migration Assistant

Azure prerequisites:

  1. Permission to create an Azure SQL Database

Run this sample

  1. Open the script in a text editor and add the following values to the EXECUTE FUNCTIONS section.

    • serverName
    • databaseName
    • jsonDirectory
    • processTo

    For more information, see Consolidate Assessment Reports.

  2. Set PowerShell execution policy to bypass for current session, as follows.

    Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass

  3. Run the script in PowerShell.

Sample details

PowerShell script for imports assessment results from JSON files into a SQL Server database. The results are imported into the table ReportData. Views, stored procedures, and table types are created in the SQL Server instance and database that you specified in the script. For more information, see Consolidate Assessment Reports.

Disclaimers

This sample code is provided for the purpose of illustration only and is not intended to be used in a production environment. The sample code and any related information are provided "as is" without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

For more information, see these articles:

Consolidate Assessment Reports