none
Problem with a restor point script, please help me

    Question

  • I have a problem with my restor point form SQL

    these ar my scripts: these are on my usb-stick, So the file name is F.

    -- Filepad:  F:\CVO cursus database. (this is the correct file name).
    :r "F:\CVO cursus database\BoekenCreateTable.sql"
    :r "F:\CVO cursus database\BoekenDropTable.sql"
    :r "F:\CVO cursus database\BoekenCreateTable.sql"
    :r "F:\CVO cursus database\BoekenAlterTableAddCommentaar.sql"
    :r "F:\CVO cursus database\BoekenAlterTableDropCommentaar"
    :r "F:\CVO cursus database\BoekenAlterTableAlterFamilienaamNotNull.sql"
    ;r "F:\CVO cursus database\BoekenAlterTableAddCategorie.sql"
    ;r "F:\CVO cursus database\BoekenAlterTableVergrootUitgeverij.sql"
    ;r "F:\CVO cursus database\BoekenInsertEen.sql"
    ;r "F:\CVO cursus database\BoekenInsertAll.sql"
    ;r "F:\CVO cursus database\BoekenInsertAllVanIedereen.sql"
    ;r "F:\CVO cursus database\BoekenUpdateCategorie.sql"
    ;r "F:\CVO cursus database\BoekenUpdateCategorieBis.sql"

    when I want to test this :r "F:\CVO cursus database\BoekenAlterTableAddCommentaar.sql"

    I'll get this error: Msg 2705, Level 16, State 4, Line 2
    Column names in each table must be unique. Column name 'Commentaar' in table 'Boeken' is specified more than once.

    all the others work, only thisone does not work, can you help me please.

    I thank you all very much in advance.

    Friendly greetings,

    Werner

    -- Filepad:  F:\CVO cursus database
    :r "F:\CVO cursus database\BoekenCreateTable.sql"
    :r "F:\CVO cursus database\BoekenDropTable.sql"
    :r "F:\CVO cursus database\BoekenCreateTable.sql"
    :r "F:\CVO cursus database\BoekenAlterTableAddCommentaar.sql"
    :r "F:\CVO cursus database\BoekenAlterTableDropCommentaar"
    :r "F:\CVO cursus database\BoekenAlterTableAlterFamilienaamNotNull.sql"
    :r "F:\CVO cursus database\BoekenAlterTableAddCategorie.sql"
    :r "F:\CVO cursus database\BoekenAlterTableVergrootUitgeverij.sql"
    :r "F:\CVO cursus database\BoekenInsertEen.sql"
    :r "F:\CVO cursus database\BoekenInsertAll.sql"
    :r "F:\CVO cursus database\BoekenInsertAllVanIedereen.sql"
    :r "F:\CVO cursus database\BoekenUpdateCategorie.sql"
    :r "F:\CVO cursus database\BoekenUpdateCategorieBis.sql"
    

    -- Filepad:  F:\CVO cursus database
    :r "F:\CVO cursus database\BoekenCreateTable.sql"
    :r "F:\CVO cursus database\BoekenDropTable.sql"
    :r "F:\CVO cursus database\BoekenCreateTable.sql"
    :r "F:\CVO cursus database\BoekenAlterTableAddCommentaar.sql"
    :r "F:\CVO cursus database\BoekenAlterTableDropCommentaar"
    :r "F:\CVO cursus database\BoekenAlterTableAlterFamilienaamNotNull.sql"
    :r "F:\CVO cursus database\BoekenAlterTableAddCategorie.sql"
    :r "F:\CVO cursus database\BoekenAlterTableVergrootUitgeverij.sql"
    :r "F:\CVO cursus database\BoekenInsertEen.sql"
    :r "F:\CVO cursus database\BoekenInsertAll.sql"
    :r "F:\CVO cursus database\BoekenInsertAllVanIedereen.sql"
    :r "F:\CVO cursus database\BoekenUpdateCategorie.sql"
    :r "F:\CVO cursus database\BoekenUpdateCategorieBis.sql"
    

    -- Filename:  F:\CVO cursus database
    :r "F:\CVO cursus database\BoekenCreateTable.sql"
    :r "F:\CVO cursus database\BoekenDropTable.sql"
    :r "F:\CVO cursus database\BoekenCreateTable.sql"
    :r "F:\CVO cursus database\BoekenAlterTableAddCommentaar.sql"
    :r "F:\CVO cursus database\BoekenAlterTableDropCommentaar"
    :r "F:\CVO cursus database\BoekenAlterTableAlterFamilienaamNotNull.sql"
    :r "F:\CVO cursus database\BoekenAlterTableAddCategorie.sql"
    :r "F:\CVO cursus database\BoekenAlterTableVergrootUitgeverij.sql"
    :r "F:\CVO cursus database\BoekenInsertEen.sql"
    :r "F:\CVO cursus database\BoekenInsertAll.sql"
    :r "F:\CVO cursus database\BoekenInsertAllVanIedereen.sql"
    :r "F:\CVO cursus database\BoekenUpdateCategorie.sql"
    :r "F:\CVO cursus database\BoekenUpdateCategorieBis.sql"
    

    Friday, April 05, 2013 4:36 PM

All replies

  •  The error is obvious, in that script you are trying to add a column, which is already existing in the table. all columns in the table should be unique. so, if you open the create table script, you will see a column 'Commentaar'.and you are trying to add the same column again, which wont work the obvious error message. So, either run the dropCommentaar script first and run AddCommentaar script or rename the column to something else.

    Hope it Helps!!


    • Edited by Stan210 Friday, April 05, 2013 4:47 PM
    Friday, April 05, 2013 4:43 PM
  • Thank you very much :-) I thank you very kindly.

    But now I have a other problem. I'm learning a lot, but I'm a beginner. Please help.

    :r "F:\CVO cursus database\BoekenCreateTable.sql" :r "F:\CVO cursus database\BoekenDropTable.sql" :r "F:\CVO cursus database\BoekenAlterTableAddCommentaar.sql" :r "F:\CVO cursus database\BoekenAlterTableDropCommentaar" :r "F:\CVO cursus database\BoekenAlterTableAlterFamilienaamNotNull.sql" :r "F:\CVO cursus database\BoekenAlterTableAddCategorie.sql" :r "F:\CVO cursus database\BoekenAlterTableVergrootUitgeverij.sql" :r "F:\CVO cursus database\BoekenInsertEen.sql" :r "F:\CVO cursus database\BoekenInsertAll.sql" :r "F:\CVO cursus database\BoekenInsertAllVanIedereen.sql" :r "F:\CVO cursus database\BoekenUpdateCategorie.sql" :r "F:\CVO cursus database\BoekenUpdateCategorieBis.sql"

    If I try to test this :r "F:\CVO cursus database\BoekenAlterTableDropCommentaar" first and then this

    :r "F:\CVO cursus database\BoekenAlterTableAddCommentaar.sql"

    I'll get this error

    A fatal scripting error occurred.
    The file specified for :r command was not found.

    I hope you can help me please, its means so much to me, because I like my studies so much.

    Friday, April 05, 2013 5:01 PM