Search code examples
sql-serversitecoresitecore6sitecore7

Sitecore Invalid Column Name 'Stamp'


We have recently upgraded from Sitecore 6.5, rev. 4 to Sitecore 6.6 initial release - and finally to Sitecore 7.0, initial release.

At this point I first began getting the following error (after logging into the content editor and performing a few simple operations): Invalid object name 'EventQueue'. Upon investigating this, I discovered that our Sitecore databases were outright 'missing' this table, which I then added to each of the databases. I resumed testing and promptly discovered the missing column 'stamp' error.

My question is, at what point was this field added to the table, and what data type should it be - I'm guessing bigint, but I'd like to be sure? Also, by chance are there any other known changes to this table and/or the schema, (since it's introduction in 6.3), that I should be aware of, ahead of time?

I really, really don't want to have to back-track and try to re-run the SQL scripts for every upgrade version since Sitecore 6.3. Just the thought of that makes me sick to my stomach...


Solution

  • The EventQueue table has not changed from Sitecore 6.3 rev 110112 (Initial Release) to the latest version of Sitecore. You could drop and re-create the EventQueue table:

    CREATE TABLE [dbo].[EventQueue](
        [Id] [uniqueidentifier] NOT NULL,
        [EventType] [nvarchar](256) NOT NULL,
        [InstanceType] [nvarchar](256) NOT NULL,
        [InstanceData] [nvarchar](max) NOT NULL,
        [InstanceName] [nvarchar](128) NOT NULL,
        [RaiseLocally] [int] NOT NULL,
        [RaiseGlobally] [int] NOT NULL,
        [UserName] [nvarchar](128) NOT NULL,
        [Stamp] [timestamp] NOT NULL,
        [Created] [datetime] NOT NULL
    ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
    
    GO
    
    ALTER TABLE [dbo].[EventQueue] ADD  CONSTRAINT [DF_EventQueue_Created]  DEFAULT (getutcdate()) FOR [Created]
    GO
    

    Note that you could download the latest version of Sitecore from SDN as a zip archive and attach the empty databases to compare. Previous versions are also available for download.

    But since you may have missed out on a whole bunch of other stuff, I would recommend you compare the database schema from a fresh DB using something like Redgate SQL Compare or Microsoft SQL Server Data Tools from within Visual Studio