Unable to insert into one particular table(this is a batch job)

  • You have a situation where you are able to insert values into most of the tables present in the database except for one.

    We tried creating a temporary table and inserted the contents we want to insert into that and it ran fine.

    On trying with this table, it fails and only about 1/10 th number of rows are inserted.

    Would you run a dbcc checktable?

    If there are other suggestions, please let me know.

    M&M

  • Please post the table definition here(along with constraints info, if any). Also, check for any triggers(especially insert triggers) on that table.

  • Are you getting an error message of any sort?

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • MANU-J. (5/17/2010)


    Please post the table definition here(along with constraints info, if any). Also, check for any triggers(especially insert triggers) on that table.

    There are no triggers or constraints. Here is the table definition. I have removed the column names

    CREATE TABLE dbo.tablename

    (

    char(10) NOT NULL,

    char(2) NOT NULL,

    char(2) NOT NULL,

    char(2) NOT NULL,

    numeric(11,0) NULL,

    numeric(11,0) NULL,

    numeric(11,0) NULL,

    numeric(11,0) NULL,

    numeric(11,0) NULL,

    numeric(11,0) NULL,

    numeric(11,0) NULL,

    numeric(11,0) NULL,

    numeric(11,0) NULL,

    numeric(11,0) NULL,

    numeric(11,0) NULL,

    numeric(7,2) NULL,

    numeric(7,2) NULL,

    numeric(7,2) NULL,

    numeric(7,2) NULL

    )

    M&M

  • CirquedeSQLeil (5/17/2010)


    Are you getting an error message of any sort?

    No error messages recorded on log.

    M&M

  • When you say that it is done via batch, how are you doing that?

    DTS, SSIS, BCP, stored proc?

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • mohammed moinudheen (5/17/2010)


    On trying with this table, it fails and only about 1/10 th number of rows are inserted.

    What is the error message that does show up? And no, not talking about the log. What error message do you get when you try to insert to it via SSMS?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Dear All,

    Thanks for all your prompt response. I was working with an application team member and it was his job which was failing. I was helping to fix it. Looks like, now he has overcome the problem. I am not sure what was the error, will find out from him.

    Thanks for your time.

    M&M

  • You're welcome and thanks for posting back to let us know that it is resolved.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

Viewing 9 posts - 1 through 8 (of 8 total)

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