Save-SqlMigrationReport
Generates In-Memory OLTP Migration Checklist
Syntax
Default (Default)
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.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | 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.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-InputObject
The object (either a Database, a Table, or a Stored Procedure SMO object) on which to generate the report.
Parameter properties
Type: | SqlSmoObject |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-MigrationType
The type of the migration. Currently, only OLTP
is supported.
Parameter properties
Type: | MigrationType |
Default value: | None |
Accepted values: | OLTP |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-Object
The name of the object (Table or Stored Procedure) for which the report is going to be generated.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | 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.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-Schema
The schema of the object (Table or Stored Procedure) for which the report is going to be generated.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-Server
The name of server to connect to (either MYCOMPUTER or MYCOMPUTER\MYINSTANCE).
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | 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.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.