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:
- PowerShell
- SQL Server 2016 (or higher) or an Azure SQL Database
- Data Migration Assistant
Azure prerequisites:
- Permission to create an Azure SQL Database
Run this sample
-
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.
-
Set PowerShell execution policy to bypass for current session, as follows.
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass -
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.
Related Links
For more information, see these articles: