November Happy Hour will be moved to Thursday December 5th.

Repair database? missing stored procedures etc.

Vote:
 

Hi,

somehow our database in production is missing several stored procedures regarding Activity Log and some columns in tblActivityLog. No idea how that happened, no one has changed anything... :)

Is there a way to recreate these things without loosing data?

We are on Episerver CMS 10.10.4

Thanks in advance!

#207395
Edited, Sep 18, 2019 16:47
Vote:
 

Hi Malin,

This is Create script for ActivityLog table on Episerver CMS 10:

CREATE TABLE [dbo].[tblActivityLog](
	[pkID] [bigint] IDENTITY(1,1) NOT NULL,
	[LogData] [nvarchar](max) NULL,
	[ChangeDate] [datetime] NOT NULL,
	[Type] [nvarchar](50) NOT NULL,
	[Action] [int] NOT NULL,
	[ChangedBy] [nvarchar](255) NOT NULL,
	[RelatedItem] [nvarchar](255) NULL,
	[Deleted] [bit] NOT NULL,
 CONSTRAINT [PK_tblActivityLog] PRIMARY KEY CLUSTERED 
(
	[pkID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

ALTER TABLE [dbo].[tblActivityLog] ADD  CONSTRAINT [DF_tblActivityLog_Action]  DEFAULT ((0)) FOR [Action]

ALTER TABLE [dbo].[tblActivityLog] ADD  DEFAULT ((0)) FOR [Deleted]

You can manually add missing columns to ActivityLog table to avoid losing data. 

If this still doesn't work, please send me episerver log so I can investigate deeper solution.

#207405
Edited, Sep 19, 2019 4:53
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.