Upgrade failure from 9009 to 9200

Upgrade failure from 9009 to 9200

Error trace:

[com.adventnet.servicedesk.updatemgr.util.SDPostProcessor] [INFO] : Problem during installation of patch {0}java.sql.SQLException: Cannot find the object "PgSQLErrorCode" because it does not exist or you do not have permissions.

Cause:

This occurs when there is no such table but the application tries to find it. Here we need to manually add the same and proceed further. Mostly occurs in MSSQL.

Fix:

Connect to SQL studio and in the database linked to the MSP application, right click->new query and execute the below query. 

select * from PgSQLErrorCode;

If there is no table present in the database (we can safely say that there is no such entry in this case), execute the following:

USE [DB_NAME]
GO

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[PgSQLErrorCode](
[ERRORCODE] [nvarchar](100) NOT NULL,
[ADVERRORCODE] [int] NOT NULL,
[ERRORMESSAGE] [nvarchar](250) NULL,
CONSTRAINT [PgSQLErrorCode_PK] PRIMARY KEY CLUSTERED 
(
[ERRORCODE] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[PgSQLErrorCode] WITH CHECK ADD CONSTRAINT [PgSQLErrorCode_FK] FOREIGN KEY([ADVERRORCODE])
REFERENCES [dbo].[AdventNetErrorCode] ([ERRORCODE])
GO

ALTER TABLE [dbo].[PgSQLErrorCode] CHECK CONSTRAINT [PgSQLErrorCode_FK]
GO