--- title: "PowerShell Cmdlet for Migration Evaluation | Microsoft Docs" ms.custom: "" ms.date: "07/30/2019" ms.prod: sql ms.prod_service: "database-engine, sql-database" ms.reviewer: "" ms.technology: in-memory-oltp ms.topic: conceptual ms.assetid: 117250d3-9982-47fe-94fd-6f29f6159940 author: MightyPen ms.author: genemi monikerRange: "=azuresqldb-current||>=sql-server-2016||=sqlallproducts-allversions||>=sql-server-linux-2017||=azuresqldb-mi-current" --- # PowerShell Cmdlet for Migration Evaluation [!INCLUDE[appliesto-ss-asdb-xxxx-xxx-md](../../includes/appliesto-ss-asdb-xxxx-xxx-md.md)] The `Save-SqlMigrationReport` cmdlet is a tool that evaluates the migration fitness of multiple objects in a SQL Server database. Currently, this cmdlet is limited to evaluating the migration fitness for In-Memory OLTP. The cmdlet can run in both an elevated Windows PowerShell environment and sqlps. As an alternative to running this PowerShell cmdlet directly, you can run the cmdlet implicitly by using SQL Server Management Studio (SSMS). In the SSMS **Object Explorer**, you can right-click a table, and then click **Memory Optimization Advisor**. ## Syntax ``` Save-SqlMigrationReport -FolderPath [ -MigrationType ] [ [ -Server -Database [ -Schema ] [ -Object ] ] | [ -InputObject ] ] ; ``` ## Parameters The following table describes the parameters. There are syntax aspects that should be emphasized. If you specify the parameter `-InputObject`, then you cannot specify any of the following parameters: - `-Server` - `-Database` - `-Schema` - `-Object` Conversely, if you do _not_ specify `-InputObject`, then you must specify `-Server` and `-Database`. If you specify `-Server`, you have the option to narrow the scope by specifying either `-Schema` or `-Object`, or both. | Parameter name | Description | | :------------- | :---------- | | Database | The name of the target SQL Server database. Mandatory when `-Server` is mandatory.

Optional in SQLPS. | | FolderPath | The folder under which the cmdlet should store the generated reports.

Required. | | InputObject | The SMO object the cmdlet should target.

Mandatory in Windows Powershell environment if `-Server` is not supplied.

Optional in SQLPS. | | MigrationType | The type of migration scenario the cmdlet is targeting. Currently the only value is the default **'OLTP'**.

Optional. | | Object | The name of the object to report about. Can be a table or stored procedure. | | Password | Required when `-Username` is required. | | Schema | The name of the schema that owns the object to be reported about.

Optional. | | Server | The name of the target SQL Server instance. Mandatory in Windows Powershell environment if `-InputObject` parameter is not supplied.

Optional in SQLPS. | | Username | Required when connecting through SQL Server Authentication, as opposed to Windows Authentication. Otherwise omit. | |   |   | ## Prerequisites Before you can run this cmdlet, you must first install the module named **SqlServer**: - `Install-Module -Name SqlServer` > [!NOTE] > The old `SQLPS` module is no longer being maintained. Use the newer `SqlServer` module. For more information, see [Install SQL Server PowerShell module](../../powershell/download-sql-server-ps-module.md). ## Example cmdlet line Next is the actual cmdlet line that ran to generate the report that is displayed later in this article. ```powershell Save-SqlMigrationReport ` -FolderPath 'C:\Test\PowerShell-ps1\Save-SqlMigrationReport\' ` -Server 'MyUserName123456.database.windows.net' ` -Database 'MyDatabaseName_31' ` -Schema 'dbo' ` -Object 'Table2' ` -Username 'MyUserName' ` -Password 'MyPassword' ` -MigrationType 'OLTP' ` ; ``` ## Example output report Under the folder specified for the `-FolderPath` parameter, the following two folder paths are created by running this cmdlet. Both paths start with the _server\_name_ value: - MyDatabaseName_31\Tables\ - MyDatabaseName_31\Stored Procedures\ Each object report file is stored under the appropriate folder. The report file names have the extension **.html**. For instance, an actual generated file name was **MigrationAdvisorChecklistReport_Table2_20190728.html**. The HTML is mostly a two-column table with the following headers: - Description - Validation Result Next is an actual example of the HTML report for one table. ```html Memory optimization checklist for [MyDatabaseName_31].[Table2]

Memory optimization checklist for [MyDatabaseName_31].[Table2]

Report Date/Time:7/28/2019 2:25 PM

Description Validation Result
No unsupported data types are defined on this table. Succeeded
No sparse columns are defined for this table. Succeeded
No identity columns with unsupported seed and increment are defined for this table. Succeeded
No foreign key relationships are defined on this table. Succeeded
No unsupported constraints are defined on this table. Succeeded
No unsupported indexes are defined on this table. Succeeded
No unsupported triggers are defined on this table. Succeeded
Post migration row size does not exceed the row size limit of memory-optimized tables. Succeeded
Table is not partitioned or replicated. Succeeded
``` And next is an approximation of what the table looks like. | Description | Validation Result | | :---------- | :---------------- | | No unsupported data types are defined on this table. | Succeeded | | No sparse columns are defined for this table. | Succeeded | | No identity columns with unsupported seed and increment are defined for this table. | Succeeded | | No foreign key relationships are defined on this table. | Succeeded | | No unsupported constraints are defined on this table. | Succeeded | | No unsupported indexes are defined on this table. | Succeeded | | No unsupported triggers are defined on this table. | Succeeded | | Post migration row size does not exceed the row size limit of memory-optimized tables. | Succeeded | | Table is not partitioned or replicated. | Succeeded | |   |   | ## Related links - Reference documentation: [Save-SqlMigrationReport](/powershell/module/sqlserver/save-sqlmigrationreport?view=sqlserver-ps)