Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import-D365Bacpac generate Set-SqlBacpacValues : Cannot bind parameter because parameter 'TrustedConnection' is specified more than once. #765

Closed
TrudAX opened this issue Oct 18, 2023 · 1 comment · Fixed by #767

Comments

@TrudAX
Copy link

TrudAX commented Oct 18, 2023

When I tried to run the following command(to restore Tier2 to Tier1) on the latest .72 version

Import-D365Bacpac -BacpacFile $filePathpac -ImportModeTier1 -NewDatabaseName $fileDB

I got the following exception:

Set-SqlBacpacValues : Cannot bind parameter because parameter 'TrustedConnection' is specified more than once. To provide multiple values to parameters that can accept multiple values, use the array syntax. For example, 
"-parameter value1,value2,value3".
At line:19940 char:44
+         $res = Set-SqlBacpacValues @Params -TrustedConnection $UseTru ...
+                                            ~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Set-SqlBacpacValues], ParameterBindingException
    + FullyQualifiedErrorId : ParameterAlreadyBound,Set-SqlBacpacValues

the import seems working, so just an exception is generated
I do not use Set-SqlBacpacValues anywhere, so the call seems to be inside the import

Expected results:
The exception should not be displayed

@FH-Inway
Copy link
Member

Sorry, that was my bad. As part of 94a46bf, I did some refactoring and made a mistake. Should be fixed by #767

As a workaround till the fix gets released, to prevent the exception, run Import-D365Bacpac with the -ImportOnly switch or go back to version 0.7.1 or an earlier version.

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 a pull request may close this issue.

2 participants