Dela via


Save-SqlMigrationReport

Generates In-Memory OLTP Migration Checklist

Syntax

Save-SqlMigrationReport
    [-Server <String>]
    [-Database <String>]
    [-Schema <String>]
    [-Username <String>]
    [-Password <String>]
    [-Object <String>]
    [-InputObject <SqlSmoObject>]
    [-MigrationType <MigrationType>]
    [-FolderPath <String>]
    [<CommonParameters>]

Description

The Save-SqlMigrationReport generates an In-Memory OLTP Migration Checklist.

This informs you about which tables in your database will benefit if ported to use In-Memory OLTP. After you identify a table that you would like to port to use In-Memory OLTP, you can use the memory optimization advisor in SQL Server Management Studio to help you migrate the disk-based table to a memory-optimized table.

Note: This cmdlet is only available for PowerShell 5 (v21). It is not longer available in v22+ of the SQLServer module.

Examples

Example 1

PS C:\> Save-SqlMigrationReport -Server 'MySQLServer' -Database 'MyDB' -FolderPath 'C:\MigrationReports'

This command will generate a report for all tables and stored procedures in database MyDb on server MySQLServer. Report file (.html format) will be created for each database object and saved under C:\MigrationReports\MyDB either under Stored Procedure or Tables.

Example 2

PS C:\> $db = Get-Item 'SQLSERVER:\SQL\MySQLServer\DEFAULT\Databases\MyDB'
PS C:\> Save-SqlMigrationReport -FolderPath 'C:\MigrationReports' -InputObject $db

This command will generate the same report as Example 1; the InputObject is passed explicitly and encapsulate both the information about the server and the database.

Example 3

PS C:\> CD 'SQLSERVER:\SQL\MySQLServer\DEFAULT\Databases\MyDB'
PS SQLSERVER:\SQL\MySQLServer\DEFAULT\Databases\MyDB> Save-SqlMigrationReport -FolderPath 'C:\MigrationReports'

This command will generate the same report as Example 1 and 2. Note that the InputObject is inferred from the context, i.e. the current working directory.

Parameters

-Database

The name of the databased for which the report is going to be generated.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-FolderPath

A path to a folder where the report files will be saved to. Report files will be organized under a folder with the same name as the the value of the Database parameter nested under either a Stored Procedure or Tables folder, depending on the type of the object.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InputObject

The object (either a Database, a Table, or a Stored Procedure SMO object) on which to generate the report.

Type:SqlSmoObject
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-MigrationType

The type of the migration. Currently, only OLTP is supported.

Type:MigrationType
Accepted values:OLTP
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Object

The name of the object (Table or Stored Procedure) for which the report is going to be generated.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Password

Specifies the password for the SQL Server Authentication login ID that was specified in the Username parameter. Passwords are case-sensitive. When possible, use Windows Authentication. Do not use a blank password, when possible use a strong password.

If you specify the Password parameter followed by your password, the password is visible to anyone who can see your monitor.

If you code Password followed by your password in a .ps1 script, anyone reading the script file will see your password.

Assign the appropriate NTFS permissions to the file to prevent other users from being able to read the file.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Schema

The schema of the object (Table or Stored Procedure) for which the report is going to be generated.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Server

The name of server to connect to (either MYCOMPUTER or MYCOMPUTER\MYINSTANCE).

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Username

Specifies the login ID for making a SQL Server Authentication connection to an instance of the Database Engine.

The password must be specified through the Password parameter.

If Username and Password are not specified, this cmdlet attempts a Windows Authentication connection using the Windows account running the Windows PowerShell session. When possible, use Windows Authentication.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False