Executing script files from my hard drive

  • I've been writing scripts in Oracle for several years, and am now working in SQL Server. In Oracle you can write create scripts and save them to a folder on your hard drive. You can then execute them in SQL Plus using the @ or Execute command specifying a path and file name.

    Is there a way to do this in SQL Server?

    Your help is greatly appreciated

  • Usually you just open in Query Analyzer and run. You can associate the file with Analyzer so you can click and open from the file then run. But when

    quote:


    execute them in SQL Plus using the @ or Execute command specifying a path and file name


    do you mean from in SQL Plus or did I misunderstand.

    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)

  • You can also use OSQL.EXE to do this - see BOL for the parameters.

    Andy

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

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