AutoSync SQL Error - 6.2.09 customer who didn't patch to 6.2.08 first

Error Displayed.

Script to run below
_____________________________________________________________________________________________________


--- Create Backup of table ---

select * into CS_TP_Setup_Back010623 from CS_TP_Setup

GO

--- Drop existing constraints ---

ALTER TABLE [dbo].[CS_TP_Setup] DROP CONSTRAINT [DF__CS_TP_Set__Defau__53F0A18E]

GO

ALTER TABLE [dbo].[CS_TP_Setup] DROP CONSTRAINT [DF_CS_TP_Setup_UseUserLevelSecurity]

GO

ALTER TABLE [dbo].[CS_TP_Setup] DROP CONSTRAINT [PK_CS_TP_Setup]

GO

--- Rename Table ---

EXEC sp_rename 'CS_TP_Setup', 'CS_TP_Setup_old'

GO

/****** Create Table Object: Table [dbo].[CS_TP_Setup] Script Date: 1/5/2023 4:50:30 PM ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

CREATE TABLE CS_TP_Setup (

[Id] [int] IDENTITY(1,1) NOT NULL,

[IntegrationId] [int] NOT NULL,

[Description] [nvarchar](50) NOT NULL,

[UseUserLevelSecurity] [bit] NOT NULL,

[UserName] [nvarchar](50) NOT NULL,

[Password] [nvarchar](50) NOT NULL,

[ServiceUrl] [nvarchar](150) NOT NULL,

[ApiKey1] [nvarchar](50) NOT NULL,

[ApiKey2] [nvarchar](50) NOT NULL,

[ApiKey3] [nvarchar](50) NOT NULL,

[CSSystemLabel] [nvarchar](100) NOT NULL,

[DefaultAccountingCompany] [nvarchar](50) NOT NULL,

[AutoSync] [smallint] NOT NULL,

CONSTRAINT [PK_CS_TP_Setup] PRIMARY KEY CLUSTERED

(

[Id] ASC

)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = ON, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 80 ) ON [PRIMARY]

) ON [PRIMARY]

GO

ALTER TABLE [dbo].[CS_TP_Setup] ADD CONSTRAINT [DF_CS_TP_Setup_UseUserLevelSecurity] DEFAULT ((0)) FOR [UseUserLevelSecurity]

GO

ALTER TABLE [dbo].[CS_TP_Setup] ADD DEFAULT ('') FOR [DefaultAccountingCompany]

GO

ALTER TABLE [dbo].[CS_TP_Setup] ADD DEFAULT ((1)) FOR [AutoSync]

GO

--- Insert Records from Backup into New Table ---

INSERT INTO CS_TP_Setup

( IntegrationId

,Description

,UseUserLevelSecurity

,UserName

,Password

,ServiceUrl

,ApiKey1

,ApiKey2

,ApiKey3

,CSSystemLabel

,DefaultAccountingCompany)

Select

IntegrationId

,Description

,UseUserLevelSecurity

,UserName

,Password

,ServiceUrl

,ApiKey1

,ApiKey2

,ApiKey3

,CSSystemLabel

,DefaultAccountingCompany

From CS_TP_Setup_Back010623

GO

Was this article helpful?
Thank you for your feedback!
User Icon

Thank you! Your comment has been submitted for approval.