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. Sql/osql help

Sql/osql help

Scheduled Pinned Locked Moved Database
databasehelpquestionsales
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.
  • D Offline
    D Offline
    DxSolo
    wrote on last edited by
    #1

    ok i work for a company and we use msde for our software that we distribute. This means we need to run creation scripts on every new customer. I know there is a tool called osql. we have the msde database using windows auth. where i run into a problem is when i put this on someones machine and try to run osql it asks me for a password. it does not ask for a user name and you can't type anything in for the password so i hit enter and then it tells me that it is invalid so how do i go about fixing this problem?

    B A 2 Replies Last reply
    0
    • D DxSolo

      ok i work for a company and we use msde for our software that we distribute. This means we need to run creation scripts on every new customer. I know there is a tool called osql. we have the msde database using windows auth. where i run into a problem is when i put this on someones machine and try to run osql it asks me for a password. it does not ask for a user name and you can't type anything in for the password so i hit enter and then it tells me that it is invalid so how do i go about fixing this problem?

      B Offline
      B Offline
      basementman
      wrote on last edited by
      #2

      Why do things the hard way? Why not just create a database with an empty structure, do a sp_detachdb and ship the MDF file as part of your install... Then, write a program that does a sp_attachsinglefiledb and your DONE.  onwards and upwards...

      D 1 Reply Last reply
      0
      • B basementman

        Why do things the hard way? Why not just create a database with an empty structure, do a sp_detachdb and ship the MDF file as part of your install... Then, write a program that does a sp_attachsinglefiledb and your DONE.  onwards and upwards...

        D Offline
        D Offline
        DxSolo
        wrote on last edited by
        #3

        i have tried that but cant quite get the syntax right could you provide a little more help and by the way thanks

        B 1 Reply Last reply
        0
        • D DxSolo

          i have tried that but cant quite get the syntax right could you provide a little more help and by the way thanks

          B Offline
          B Offline
          basementman
          wrote on last edited by
          #4

          I assume that you looked up sp_detach_db in the Books Online, so.... Assuming your db name is MyDB: exec sp_detach_db 'MyDB' then, simply include the MyDB.mdf file on your install and copy it to your install dir (assumes c:\MyApp\Data) after the install, call a program that connects to MSDE and issues the following command: exec sp_attach_single_file_db 'MyDB', 'c:\MyApp\Data\MyDB.mdf' then you are DONE. Just make sure that MSDE is installed with the same charset and sort order as you are using in-house.  onwards and upwards...

          D 1 Reply Last reply
          0
          • B basementman

            I assume that you looked up sp_detach_db in the Books Online, so.... Assuming your db name is MyDB: exec sp_detach_db 'MyDB' then, simply include the MyDB.mdf file on your install and copy it to your install dir (assumes c:\MyApp\Data) after the install, call a program that connects to MSDE and issues the following command: exec sp_attach_single_file_db 'MyDB', 'c:\MyApp\Data\MyDB.mdf' then you are DONE. Just make sure that MSDE is installed with the same charset and sort order as you are using in-house.  onwards and upwards...

            D Offline
            D Offline
            DxSolo
            wrote on last edited by
            #5

            thanks a billion man

            1 Reply Last reply
            0
            • D DxSolo

              ok i work for a company and we use msde for our software that we distribute. This means we need to run creation scripts on every new customer. I know there is a tool called osql. we have the msde database using windows auth. where i run into a problem is when i put this on someones machine and try to run osql it asks me for a password. it does not ask for a user name and you can't type anything in for the password so i hit enter and then it tells me that it is invalid so how do i go about fixing this problem?

              A Offline
              A Offline
              Arjan Einbu
              wrote on last edited by
              #6

              Look at the help: osql -? Examples: osql -S_myserver_ -U_myusername_ -P_mypassword_ for supplying username and password or osql -E to use a trusted connection. Then you can also specify the scriptfile to be executed by adding the -i_scriptfile_ parameter. These options are case-sensitive.

              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