Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 3 of 3

Thread: Error in Insert Function

  1. #1
    harsha.gus is offline Senior Member
    Join Date
    Mar 2009
    Posts
    301

    Exclamation Error in Insert Function

    HI,
    when I try to insert few rows for category table I get this error.
    Could any one tell me what I can do to be able to execute this query.

    Code:
    INSERT INTO Category (CategoryID, CategoryGUID, [Name], Summary, [Description], SEKeywords, SEDescription, DisplayPrefix, SETitle, SENoScript, SEAltText, ParentCategoryID, ColWidth, SortByLooks, DisplayOrder, RelatedDocuments, XmlPackage, Published, AllowSectionFiltering, AllowManufacturerFiltering, AllowProductTypeFiltering, QuantityDiscountID, ShowInProductBrowser, SEName, ExtensionData, ContentsBGColor, PageBGColor, GraphicsColor, ImageFilenameOverride, IsImport, [Deleted], CreatedOn, PageSize, Wholesale, TaxClassID, SkinID, TemplateName) VALUES (13, '{671A6F82-2FDC-4603-B00C-1ABCD6D55C2F}', 'Norstar', '', '', NULL, NULL, NULL, NULL, NULL, NULL, 0, 4, 0, 5, NULL, 'entity.gridwithprices.xml.config', 1, 0, 0, 0, 0, 1, 'norstar', NULL, '', '', '', '', 0, 1, '2005-12-13 17:15:46', 20, 1, 1, 0, '');
    COMMIT
    GO
    Cannot insert explicit value for identity column in table 'Category' when IDENTITY_INSERT is set to OFF.
    rbgx
    AspDotNetStorefront ML
    v8.0.1.4

  2. #2
    AspDotNetStorefront Staff - Scott's Avatar
    AspDotNetStorefront Staff - Scott is offline Administrator
    Join Date
    Mar 2007
    Location
    Ashland, OR
    Posts
    2,390

    Default

    You just need to turn identity inserts on. Do something like this:

    Code:
    set IDENTITY_INSERT [dbo].Category ON;
    INSERT INTO Category (CategoryID, CategoryGUID, [Name], Summary, [Description], SEKeywords, SEDescription, DisplayPrefix, SETitle, SENoScript, SEAltText, ParentCategoryID, ColWidth, SortByLooks, DisplayOrder, RelatedDocuments, XmlPackage, Published, AllowSectionFiltering, AllowManufacturerFiltering, AllowProductTypeFiltering, QuantityDiscountID, ShowInProductBrowser, SEName, ExtensionData, ContentsBGColor, PageBGColor, GraphicsColor, ImageFilenameOverride, IsImport, [Deleted], CreatedOn, PageSize, Wholesale, TaxClassID, SkinID, TemplateName) VALUES (13, '{671A6F82-2FDC-4603-B00C-1ABCD6D55C2F}', 'Norstar', '', '', NULL, NULL, NULL, NULL, NULL, NULL, 0, 4, 0, 5, NULL, 'entity.gridwithprices.xml.config', 1, 0, 0, 0, 0, 1, 'norstar', NULL, '', '', '', '', 0, 1, '2005-12-13 17:15:46', 20, 1, 1, 0, '');
    COMMIT
    GO
    set IDENTITY_INSERT [dbo].Category OFF;

  3. #3
    harsha.gus is offline Senior Member
    Join Date
    Mar 2009
    Posts
    301

    Smile Thank you.

    Thanks a lot
    rbgx
    AspDotNetStorefront ML
    v8.0.1.4