Database Primary Key Max Entry Fix

| | | |

Two options with this fix, official script from Ektron or to fix the individual tables that are currently having the issue.

CREATE PROCEDURE [dbo].[fixmaxentries]
AS
BEGIN
	UPDATE max_entries
	SET max_table_number = (
			SELECT MAX(PreferenceId) + 2
			FROM notification_preference
			)
	WHERE table_name = 'notification_preference';

	UPDATE max_entries
	SET max_table_number = (
			SELECT MAX(PreferenceId) + 2
			FROM notification_preference_default
			)
	WHERE table_name = 'notification_preference_default';
END
exec fixmaxentries

Individual Table(s)

Official fix from Ektron, specific to 8.0.2

Originally Posted on February 28, 2013
Last Updated on October 26, 2015
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.