script errors

  • Hi,

    I am getting an error msg while executing a script file like " script executed with errors" but not showing any errors in the results pane.

    This file includes insert scripts for at least 40 tables. the file size is 15mb. Its is not showing any errors in the reulsts pane but it is giving message like "script executed with errors" but not executing the complete scripts becuase i can find some data is missing. I felt there may be any memory issue but this is happening while running this script alone. But it exactly contains only insert scripts

    How can I resolve this issue.

  • I guess you're referring to the alert in the status line of management studio: "Query complete with errors"

    For a very long insert script the Messages pane may be full of things like '(x row(s) affected)' - but you will just have to scroll through to find the red error message. - There may be several.

    You should post the exact error mssages.

  • Rather than just trying to scroll through the Messages tab looking for the errors, just hit Ctrl+F and search for 'Msg' or 'Error' (can't remember which it is now). This should take you straight to the error description.

    When you get there, double click the red error message and it should take you to (roughly) the point in the script that caused the error.

  • Hi

    I have done the stepts mentioned earlier itself. But still not able to trace the error becuase of memory issue script is not getting executed properly and when I split the insert scripts I am able to run them

    but I want to run this file at one time instead of breaking

    So any method to clear cache memory

    Any good suggestions?????

    Thanks

  • without seeing your script, here is a common issue:

    if you ALTER a table by adding a column, and then try to INSERTfeaturing that new column , an error is raised unless a GO occurs after the ALTER

    if you run each statement separately, no problem...run this as a batch, and you will get an error:

    create table #test( testtext varchar(30), MyRand varchar(5) DEFAULT(REPLACE( STR( ABS( CHECKSUM( NEWID() ) ) % 10000, 5 ), ' ', '1' ) ) )

    alter table #test add whentext datetime

    insert into #test(testtext,whentext)

    select 'apples',getdate() union all

    select 'grapes',getdate() union all

    select 'bananas',getdate()

    select * from #test

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • This works!

    create table #test( testtext varchar(30)

    , MyRand varchar(5) DEFAULT(REPLACE( STR( ABS( CHECKSUM( NEWID() ) ) % 10000, 5 ), ' ', '1' ) ) )

    go

    alter table #test add whentext datetime

    go

    insert into #test(testtext,whentext)

    select 'apples',getdate() union all

    select 'grapes',getdate() union all

    select 'bananas',getdate()

    go

    select * from #test

    go

  • john_agger (6/26/2013)


    This works!

    create table #test( testtext varchar(30)

    , MyRand varchar(5) DEFAULT(REPLACE( STR( ABS( CHECKSUM( NEWID() ) ) % 10000, 5 ), ' ', '1' ) ) )

    go

    alter table #test add whentext datetime

    go

    insert into #test(testtext,whentext)

    select 'apples',getdate() union all

    select 'grapes',getdate() union all

    select 'bananas',getdate()

    go

    select * from #test

    go

    Note: four-year-old thread.

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

Viewing 7 posts - 1 through 6 (of 6 total)

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