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 server mdf and ldf

SQL server mdf and ldf

Scheduled Pinned Locked Moved Database
databasequestionsharepointsql-serversysadmin
4 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.
  • N Offline
    N Offline
    new2pgrmg
    wrote on last edited by
    #1

    H, I have a stored procedure in SQL server 2005 in a database.Right now i am unable to access my SQL Server and it needs reinstallation.But i need the stored procedures i have written previously in this.I know the name of teh database that contains the SP.I can see it in my programmeFiles as mdf and ldf. Once the reinstallation of my new sql server 2005 is done,i want my new sql server to have this SP.I tried to open my mdf and ldf but its not opening.I tried to copy to some location but it says "another program is using this file"-This is not true. So my question is how can i do this.I desperatly need ny SQL server after reinstallation to have these SP's since writting them again will be tedious. Many Thanks

    S S 2 Replies Last reply
    0
    • N new2pgrmg

      H, I have a stored procedure in SQL server 2005 in a database.Right now i am unable to access my SQL Server and it needs reinstallation.But i need the stored procedures i have written previously in this.I know the name of teh database that contains the SP.I can see it in my programmeFiles as mdf and ldf. Once the reinstallation of my new sql server 2005 is done,i want my new sql server to have this SP.I tried to open my mdf and ldf but its not opening.I tried to copy to some location but it says "another program is using this file"-This is not true. So my question is how can i do this.I desperatly need ny SQL server after reinstallation to have these SP's since writting them again will be tedious. Many Thanks

      S Offline
      S Offline
      Sivu
      wrote on last edited by
      #2

      From the message - "another program is using this file" - it's clear that your DB is still attached to the SQL Server. To move it you need to detach it. But for that you need to connect to the server. When you connect to your 'new' installation, can't you see the 'old' database in object explorer? You should actually have access to the complete database and not need to recreate anything...

      1 Reply Last reply
      0
      • N new2pgrmg

        H, I have a stored procedure in SQL server 2005 in a database.Right now i am unable to access my SQL Server and it needs reinstallation.But i need the stored procedures i have written previously in this.I know the name of teh database that contains the SP.I can see it in my programmeFiles as mdf and ldf. Once the reinstallation of my new sql server 2005 is done,i want my new sql server to have this SP.I tried to open my mdf and ldf but its not opening.I tried to copy to some location but it says "another program is using this file"-This is not true. So my question is how can i do this.I desperatly need ny SQL server after reinstallation to have these SP's since writting them again will be tedious. Many Thanks

        S Offline
        S Offline
        SimulationofSai
        wrote on last edited by
        #3

        What do you mean when you say you're unable to access SQL Server? Lost your password?, or is it some other error you're getting. Are you the owner of the montioned database? You have two options here 1) Try solving your existing problem and backup the database. 2) Stop the SQL Server Service, copy the mdf and ldf to a different location and do your reinstall. Once you have the new instance up, you can try attaching the mdf, although I seriously doubt if it'll succeed. It's a gamble you've to take.

        location but it says "another program is using this file"-This is not true

        This actually might mean that your SQL Server instance is still running. Try figuring out what's wrong with your login or post the error you get here.

        SG Cause is effect concealed. Effect is cause revealed.

        N 1 Reply Last reply
        0
        • S SimulationofSai

          What do you mean when you say you're unable to access SQL Server? Lost your password?, or is it some other error you're getting. Are you the owner of the montioned database? You have two options here 1) Try solving your existing problem and backup the database. 2) Stop the SQL Server Service, copy the mdf and ldf to a different location and do your reinstall. Once you have the new instance up, you can try attaching the mdf, although I seriously doubt if it'll succeed. It's a gamble you've to take.

          location but it says "another program is using this file"-This is not true

          This actually might mean that your SQL Server instance is still running. Try figuring out what's wrong with your login or post the error you get here.

          SG Cause is effect concealed. Effect is cause revealed.

          N Offline
          N Offline
          new2pgrmg
          wrote on last edited by
          #4
          1. Stop the SQL Server Service, copy the mdf and ldf to a different location and do your reinstall. Once you have the new instance up, you can try attaching the mdf, although I seriously doubt if it'll succeed. It's a gamble you've to take. I did this and am going to reinstall my SQL server 2005.I hope while attaching it will work.Any way at this point i think we have to take that risk since we dont have any other options. I will try this and will post the effects.Please be in this loop. Many Thanks
          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