Invoke-sqmCollationChange
SQL Config
sqmSQLTool v1.8.2+ · Invoke
✓ -WhatIf supported · ⚠ Service restart required
sqlservr.exe in minimal mode (-m -T4022 -T3659) to apply the new collation without a full reinstall. Handles named instances correctly (-s flag). Saves rollback documentation before making changes and verifies the result after restart. Optionally updates all user database collations as well.
Parameters
| Parameter | Type | Required | Default | Notes |
|---|---|---|---|---|
| -SqlInstance | string | Optional | $env:COMPUTERNAME | Default instance or SERVER\InstanceName. |
| -NewCollation | string | Required | — | Target collation, e.g. Latin1_General_CI_AS. |
| -BackupBeforeChange | switch | Switch | $false | Full backup of all system DBs before the change. |
| -IncludeUserDatabases | switch | Switch | $false | After system collation change: also ALTER DATABASE … COLLATE for each user DB. |
| -SqlCredential | PSCredential | Optional | — |
Execution Flow
Examples
Change collation — default instance
Invoke-sqmCollationChange -NewCollation "Latin1_General_CI_AS"
Named instance, with backup and user DB update
Invoke-sqmCollationChange `
-SqlInstance "SQL01\SQL2017" `
-NewCollation "German_CI_AS" `
-BackupBeforeChange `
-IncludeUserDatabasesPreview only — no changes made
Invoke-sqmCollationChange -SqlInstance "SQL01" -NewCollation "Latin1_General_CI_AS" -WhatIf