I had a reference field, wich was Nullable, then i change it to Not Nullabe, Now during schema upgrade this:
exec sp_rename '[dbo].[DocumentOperation].[Entity_Id]', 'TempEntity_Id', 'COLUMN';
ALTER TABLE [dbo].[DocumentOperation] ADD [Entity_Id] uniqueidentifier DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL;
CREATE INDEX [DocumentOperation_FK_Entity] ON [dbo].[DocumentOperation] ([Entity_Id] ASC);
ALTER TABLE [dbo].[DocumentOperation] ADD CONSTRAINT [FK_DocumentOperation-Entity-DocEntity_Entity] FOREIGN KEY ([Entity_Id]) REFERENCES [dbo].[DocEntity] ([Id]);
This sql misses this statement:
UPDATE dbo.DocumentOperation SET Entity_Id = TempEnity_Id; Therefore the latter ALTER fails(Entity_Id is filled with zero guids)
Updated at 26.07.2010 6:28:27
This is the whole SQL text from the exception. I cannot reproduce this once more because I've fixed it manually
This thread was imported from our support forum. The original discussion may contain more detailed answer.
asked
Jul 22 '10 at 11:19
xumix
425●75●76●82
I suspect there should be one more operation with "TempEntity_Id" column - could you check this, or send us the whole log / exception text?
Hmm, clear. It really looks like a bug - we will try to reproduce it.