SQL SERVER – Edition Upgrade – Invoke or BeginInvoke Cannot be Called on a Control Until the Window Handle has Been Created

One of a unique advantage of freelancing is learning more and more. I get a chance to hear some of the real word problem and it gives me immense pleasure to provide a feasible solution to them. This blog is interaction on the airport when I was coming back from a recent trip from Canada. After seeing me on airport, an old client of mine met and said hello. While having a discussion, he told an interesting issue of SQL upgrade and he wanted an idea. He showed me below error message related to edition upgrade.

SQL SERVER - Edition Upgrade - Invoke or BeginInvoke Cannot be Called on a Control Until the Window Handle has Been Created Setup-Invoke-01-800x186

Here is the text of the error message. Did you know that you can click on that little copy icon to get details like below?

SQL Server Setup has encountered the following error:
Invoke or BeginInvoke cannot be called on a control until the window handle has been created..

After we hit OK on the dialog, SQL Server installation exits.

WORKAROUND/SOLUTION

When I searched for the error on the internet, It was easy to find here.

But we were running SQL 2012 upgrade so above was not applicable.

I have given him below idea to avoid using UI to run the installer. I shared below with him and he agreed to update me via email if it worked for him.

setup.exe /ACTION=EditionUpgrade /INSTANCENAME=MSSQLSERVER /IACCEPTSQLSERVERLICENSETERMS  /FEATURES=SQL,RS  /INDICATEPROGRESS  /Q

How many times do you install SQL Server or a patch via command line? In larger enterprise, it is very common and they love scripts and command line. Feel free to comment and let me know.

Reference: Pinal Dave (http://blog.SQLAuthority.com)

, ,
Previous Post
SQL SERVER – SQL Audit Date Time Does Not Match Machine Date Time – Solution
Next Post
SQL SERVER – Could Not Load the DLL xpstar.dll, or One of the DLLs it References

Related Posts

1 Comment. Leave new

  • Hi Pinal,
    Is it possible to apply sql license from the command line after evaluation period is completed and sql service can’t be started ? When I try from command line after evaluation period is over and sql can’t started in the log file it keeps trying to sql and fails.
    When I run through UI from sql installation center : maintenance edition upgrade and enter the key it works fine.
    I am trying to upgrade from sql 2012 enterprise evaluation to standard. Please let me know.

    I am using following script in a batch file:
    set /p key= <SqlLicense.txt
    echo %key%
    "%programfiles%\Microsoft SQL Server\110\Setup Bootstrap\SQLServer2012\setup.exe" /ACTION=EditionUpgrade /INSTANCENAME= /PID=”%key%” /IACCEPTSQLSERVERLICENSETERMS /q /INDICATEPROGRESS >> sql.log

    If I run it from sql installation center UI edition upgrade is successful but when I run using the setup.exe /action = EditionUpgrade

    SQLEngine: –FacetOnlySupportedFeaturesUsedCheckSystem: Engine_OnlySupportedFeaturesUsedCheckSystem: Exception: A network-related or instance-specific error occurred while establishing a connection to SQL server. The server was not found or was not accessible. Verify that the instance is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error : 0 – No connection could be made because the target machine actively refused it.). Rule failed.
    Sco: Attempting to initialize script
    Sco: Attempting to initialize default connection string
    Sco: Attempting to set script connection protocol to NotSpecified
    Sco: Attempting to set script connection protocol to NotSpecified
    Sco: Attempting to connect script
    Connection string: Data Source=.\;Initial Catalog=master;Integrated Security=True;Pooling=False;Connect Timeout=300;Application Name=SqlSetup
    Sco: Connection error code from SqlException is : 10061
    Sco: Attempting to dispose script
    Sco: Attempting to disconnect script
    Current SqlServer Connection closed…

    Thanks,
    Syam

    Reply

Leave a Reply

Menu