Skip to content

Copy-DbaLinkedServer - Fix provider compatibility for SQL 2022/2025#10337

Draft
andreasjordan wants to merge 1 commit intodevelopmentfrom
claude/issue-10336-20260406-1842
Draft

Copy-DbaLinkedServer - Fix provider compatibility for SQL 2022/2025#10337
andreasjordan wants to merge 1 commit intodevelopmentfrom
claude/issue-10336-20260406-1842

Conversation

@andreasjordan
Copy link
Copy Markdown
Collaborator

Fix two issues that caused failures when copying linked servers to SQL Server 2022+:

  1. Fix operator precedence bug in provider existence check where !$array -contains $value always evaluated to false, meaning missing providers were never caught early.

  2. Add automatic provider compatibility mapping for SQL Server version migrations. SQL Server 2022+ uses MSOLEDBSQL19 (OLE DB Driver 19) while older versions use MSOLEDBSQL (OLE DB Driver 18). When the source provider is not available on the destination, the function now automatically substitutes a known compatible alternative if one is available.

Fixes #10336

Generated with Claude Code

Fix two issues that caused failures when copying linked servers to SQL Server 2022+:

1. Fix operator precedence bug in provider existence check where
   `!$array -contains $value` always evaluated to false, meaning missing
   providers were never caught early.

2. Add automatic provider compatibility mapping for SQL Server version
   migrations. SQL Server 2022+ uses MSOLEDBSQL19 (OLE DB Driver 19) while
   older versions use MSOLEDBSQL (OLE DB Driver 18). When the source provider
   is not available on the destination, the function now automatically
   substitutes a known compatible alternative if one is available.

Fixes #10336

(do Copy-DbaLinkedServer)

Co-authored-by: Andreas Jordan <andreasjordan@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Copy-DbaLinkedServer issues copying to SQL 2022 and SQL 2025

1 participant