Got Error when inserting data into table

  • Hi all,

    When i try to insert the data from my server to my local machine at that time i got the following error.

    Msg 510, Level 16, State 2, Line 5

    Cannot create a worktable row larger than allowable maximum. Resubmit your query with the ROBUST PLAN hint.

    and then i use Option (Robust Plan) then also i got the error but the error message is:

    Msg 8619, Level 16, State 2, Line 5

    Warning: The query processor could not produce a query plan from the optimizer because the total length of all the columns in the GROUP BY or ORDER BY clause exceeds 8000 bytes. Resubmit your query without the ROBUST PLAN hint.

    I also check my table data, there is no any records whose length exceeds 8000 character....

    Need some suggestion...

    Thanks in advance

  • It's the total length that counts, not the individual columns - as it says in the error message.

    If you still can't see the problem, post the query plus the column definitions and someone will point it out to you.

    BTW - you stand a better chance of getting a quick and useful reply if you make a habit of posting data with your questions.

    Paul

  • Hi,

    Here is my table structure:

    CREATE TABLE [dbo].[tblSubDomainOld](

    [id] [int] NOT NULL,

    [SubDomain] [varchar](500) NOT NULL,

    [Query] [varchar](5000) NOT NULL,

    [hostfrom] [varchar](500) NULL,

    [chkloginhost] [varchar](50) NULL,

    [status] [bit] NULL,

    [AsQuery] [varchar](5000) NULL,

    [UserId] [varchar](200) NULL,

    [Password] [varchar](200) NULL,

    [EmailId] [varchar](500) NULL,

    [ContactUs] [varchar](8000) NULL,

    [AboutUs] [varchar](8000) NULL,

    [DomainTheme] [varchar](8000) NULL,

    [Title] [varchar](8000) NULL,

    [Keywords] [varchar](8000) NULL,

    [Description] [varchar](8000) NULL,

    [Edit] [bit] NULL

    )

    And below is my query using which i m inserting the data.

    Begin

    Truncate table [LocalDataBaseName].dbo.tblSubDomainOld

    Insert into [LocalDataBaseName].dbo.tblSubDomainOld

    Select * from [200.160.61.20].[DataBaseName].dbo.tblSubDomainOld

    end

    When i execute the above query, i got that stupid error.:hehe:

  • My guess is that it is the index(es) on the destination table that cause the problem.

    Try dropping the indexes and then doing the insert.

    Create appropriate and valid index(es) afterward.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply