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

    Question

  • :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 test this

    :r "F:\CVO cursus database\BoekenAlterTableDropCommentaar"

    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'm very new to SQL, so all the help is welcome and very much appricated.

    Thank you very much in advance for all the good help.

    Friendly greetings,

    Werner

    Friday, April 05, 2013 5:09 PM

Answers

  • Peréz he is working with SQLCMD. you read more here:
    https://www.simple-talk.com/sql/sql-tools/the-sqlcmd-workbench/

    Werner.Z try to use this format and make sure the path is OK

    :setvar path C:\"some path"
    :r $(path)\myfile.sql

    You have to put statements with a space in quotes but not the entire statement. That is why you can do C:\"some path"

    * Separate the filename from the path of the file
    * Save the path in variable
    The file name will not have spaces!
    * Then use the following format in the command

    :r $(path)\myfile.sql


    signature


    Friday, April 05, 2013 6:55 PM
    Moderator

All replies

  • Hi Werner.Z

    What are you trying to do? Please start from the beginning as I don't know what command :r 'File Name' is in SQL.


    Pérez

    As a courtesy please post table structure(s), sample data, your query and results, and your expected results.

    Friday, April 05, 2013 6:38 PM
  • Peréz he is working with SQLCMD. you read more here:
    https://www.simple-talk.com/sql/sql-tools/the-sqlcmd-workbench/

    Werner.Z try to use this format and make sure the path is OK

    :setvar path C:\"some path"
    :r $(path)\myfile.sql

    You have to put statements with a space in quotes but not the entire statement. That is why you can do C:\"some path"

    * Separate the filename from the path of the file
    * Save the path in variable
    The file name will not have spaces!
    * Then use the following format in the command

    :r $(path)\myfile.sql


    signature


    Friday, April 05, 2013 6:55 PM
    Moderator
  • Please check, if all files exists in the selected directory.

    Maybe there is a typo in some file name.

    Friday, April 05, 2013 7:25 PM