Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. How do I execute a sql script?

How do I execute a sql script?

Scheduled Pinned Locked Moved Database
databasequestioncsharpsql-serversysadmin
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mundo Cani
    wrote on last edited by
    #1

    Hello, I'm new to database programming. I'm currently reading Pro ADO.NET 2.0 from Apress. The book has been great so far, but when he get's to his first example, he supplies a script file to set up a simple data source. So, i have this .sql file that i don't know what to do with. when I double click it, it just opens in notepad. Yes, i'm a doofus. please help me! :sigh: I'm running a local instance of sql server 2005 standard. thanks! Ian

    M C 2 Replies Last reply
    0
    • M Mundo Cani

      Hello, I'm new to database programming. I'm currently reading Pro ADO.NET 2.0 from Apress. The book has been great so far, but when he get's to his first example, he supplies a script file to set up a simple data source. So, i have this .sql file that i don't know what to do with. when I double click it, it just opens in notepad. Yes, i'm a doofus. please help me! :sigh: I'm running a local instance of sql server 2005 standard. thanks! Ian

      M Offline
      M Offline
      Mike Ellison
      wrote on last edited by
      #2

      Hi Ian. If you're running Sql Server 2005, you should have access to the Query Analyzer program, yes? Open the .sql file in Query Analyzer, then execute it (F5 will do it)

      M 1 Reply Last reply
      0
      • M Mike Ellison

        Hi Ian. If you're running Sql Server 2005, you should have access to the Query Analyzer program, yes? Open the .sql file in Query Analyzer, then execute it (F5 will do it)

        M Offline
        M Offline
        Mundo Cani
        wrote on last edited by
        #3

        i can't find the query analyzer. I'm going to reinstall and give that a shot. Thanks! Ian

        C 1 Reply Last reply
        0
        • M Mundo Cani

          i can't find the query analyzer. I'm going to reinstall and give that a shot. Thanks! Ian

          C Offline
          C Offline
          Colin Angus Mackay
          wrote on last edited by
          #4

          SQL Server 2005 does not come with Query Analyser. That was a feature of SQL Server 2000. ColinMackay.net Scottish Developers are looking for speakers for user group sessions over the next few months. Do you want to know more?

          M 1 Reply Last reply
          0
          • M Mundo Cani

            Hello, I'm new to database programming. I'm currently reading Pro ADO.NET 2.0 from Apress. The book has been great so far, but when he get's to his first example, he supplies a script file to set up a simple data source. So, i have this .sql file that i don't know what to do with. when I double click it, it just opens in notepad. Yes, i'm a doofus. please help me! :sigh: I'm running a local instance of sql server 2005 standard. thanks! Ian

            C Offline
            C Offline
            Colin Angus Mackay
            wrote on last edited by
            #5

            Open Microsoft SQL Server Management Studio Connect to the SQL Server In the tree on the left open the databases folder Right click on the database you want to query and select New Query... In the main pane you can now type SQL. You can execute the SQL by pressing F5 or using the Execute button. Does this help? ColinMackay.net Scottish Developers are looking for speakers for user group sessions over the next few months. Do you want to know more?

            1 Reply Last reply
            0
            • C Colin Angus Mackay

              SQL Server 2005 does not come with Query Analyser. That was a feature of SQL Server 2000. ColinMackay.net Scottish Developers are looking for speakers for user group sessions over the next few months. Do you want to know more?

              M Offline
              M Offline
              Mike Ellison
              wrote on last edited by
              #6

              :) My mistake. :-O Thanks Colin.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups