an ASP.NET Open Source CMS & eCommerce platform
Search:
Skip Navigation LinksHome > DotShoppingCart Forums > Support > Using DotShoppingCart > SQL Migration Script errors
Last Post 1/5/2010 5:21:21 PM By lukezy. 5 replies.
1/5/2010 9:14:12 AM
bansal_db
Posts: 181
Joined: 4/13/2009
SQL Migration Script errors
I got couple of errors in the script
 
1.)
 
 
GO
DROP INDEX [IX_DSC_Manufacturer_Name]
    ON [dbo].[DSC_Manufacturer];
 
Error:
Msg 3723, Level 16, State 6, Line 1
An explicit DROP INDEX is not allowed on index 'dbo.DSC_Manufacturer.IX_DSC_Manufacturer_Name'. It is being used for FOREIGN KEY constraint enforcement.
 
 
2.)
GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_DSC_Manufacturer_Name]
    ON [dbo].[DSC_Manufacturer]([name] ASC) WITH (ALLOW_PAGE_LOCKS = ON, ALLOW_ROW_LOCKS = ON, PAD_INDEX = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, IGNORE_DUP_KEY = OFF, STATISTICS_NORECOMPUTE = OFF, ONLINE = OFF, MAXDOP = 0);
 
Error:
Msg 1913, Level 16, State 1, Line 1
The operation failed because an index or statistics with name 'IX_DSC_Manufacturer_Name' already exists on table 'dbo.DSC_Manufacturer'.
 
 
Thanks
1/5/2010 11:45:07 AM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: SQL Migration Script errors
It's not a primary cluster index. Why would it have any foreign key constraint on it? Can you tell which foreign key constraint it's complaining?
DotShoppingCart Staff
1/5/2010 12:08:40 PM
bansal_db
Posts: 181
Joined: 4/13/2009
Re: SQL Migration Script errors
i found two foreign key constraint.....
 
1.) dotshoppingcart.dbo.DSC_Category_Manufacturer_Count: FK_DSC_Category_Manufacturer_Count_DSC_Manufacturer
2.) dotshoppingcart.dbo.DSC_Product: FK_DSC_Product_DSC_Manufacturer
 
don't know which one might be causing error.....
1/5/2010 12:50:52 PM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: SQL Migration Script errors
Hmm, try dropping these two constraints and run the script. And then add these two contraints back.
DotShoppingCart Staff
1/5/2010 5:11:31 PM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: SQL Migration Script errors
Very weird. If you open the script, you will see the SQL statement actually dropping the contraints. We are investigating why these don't work.
 
ALTER TABLE [dbo].[DSC_Category_Manufacturer_Count] DROP CONSTRAINT [FK_DSC_Category_Manufacturer_Count_DSC_Manufacturer];
ALTER TABLE [dbo].[DSC_Category_Manufacturer_Count] DROP CONSTRAINT [FK_DSC_Category_Manufacturer_Count_DSC_Manufacturer];
 
DotShoppingCart Staff
1/5/2010 5:21:21 PM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: SQL Migration Script errors
Ah, found the problem. You just need to move
 
"DROP INDEX [IX_DSC_Manufacturer_Name] ON [dbo].[DSC_Manufacturer];"
 
after
 
"ALTER TABLE [dbo].[DSC_Product] DROP CONSTRAINT [FK_DSC_Product_DSC_Manufacturer];".
 
We will be fixing the zip package. You can download it again.
 
DotShoppingCart Staff