Sqlserver services failed to start after applying patch KB5040948

Avyayah 1,271 Reputation points
2024-08-16T22:21:37.4633333+00:00

Script level upgrade for database 'master' failed because upgrade step 'ISServer_upgrade.sql' encountered error 15151, state 1, severity 16. This is a serious error condition which might interfere with regular operation and the database will be taken offline. If the error happened during upgrade of the 'master' database, it will prevent the entire SQL Server instance from starting. Examine the previous errorlog entries for errors, take the appropriate corrective actions and re-start the database so that the script upgrade steps run to completion.

We have started the database with T902 flag and used this article: https://learn.microsoft.com/en-us/troubleshoot/sql/database-engine/install/windows/sql-server-upgrade-failed-error-15151

Open SQL Server Configuration Manager.

· In SQL Server Configuration Manager, click SQL Server Services.

· Double-click the SQL Server service.

· In the SQL Server Properties dialog box, click the Advanced tab.

· On click the Advanced tab, locate the Startup Parameters item.

· Add ;-T902 to the end of the existing string value, and then click OK.

· Restart the SQL server service

Did anyone else have this similar issue? Is this the parameter added to the end of of the startup parameter: ;-T902

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,629 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Erland Sommarskog 109.8K Reputation points MVP
    2024-08-17T09:02:50.46+00:00

    First of all, have you checked the SQL Server error to see why the upgrade script failed? You refer to a specific article, but there are many reasons why that script can fail.

    As for applying the trace flag, the description you give appears to be outdated. In modern versions of SQL Server Configuration Manager there is a tab Startup Parameter, and you would add the parameter as in this example:

    User's image

    But observe that 902 is nothing you should keep enabled. You would only apply it so that you can repair whatever that caused the script to fail.


  2. MikeyQiaoMSFT-0444 2,630 Reputation points
    2024-08-19T02:14:21.74+00:00

    Hi,Avyayah

    By checking the error, you can obtain more detailed information. Most of the time, the cause of this issue is missing SQL login and connect to hte SSISD.

    If you don’t create SSISDB locally (you attach by migration), the SQL login will missing.

    Steps to resolve the Script Upgrade error:

    •Apply trace flag /T902 and start the SQL Server Services

    •Create the [##MS_SSISServerCleanupJobLogin##] login

    •Stop the SQL Services and remove the /T902 trace flag

    •Start the SQL services normally using Configuration Manager

    •The SSIS upgrade script completes successfully

    Refered to

    https://blog.sqlauthority.com/2019/04/06/sql-server-script-level-upgrade-for-database-master-failed-because-upgrade-step-ssis_hotfix_install-sql-encountered-error-15151/

    https://www.sqlservice.se/script-level-upgrade-for-database-master-failed/

    Regards

    Mikey Qiao


    If you're satisfied with the answer, don't forget to "Accept it," as this will help others who have similar questions to yours.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.