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. Restore Database

Restore Database

Scheduled Pinned Locked Moved Database
databasequestion
3 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.
  • A Offline
    A Offline
    abo el ror
    wrote on last edited by
    #1

    If a database is dettached and its log file (.ldf) has been deleted, I am trying to attach this database again , but i am facing some problems. Do someone have a solution for me ?

    M 1 Reply Last reply
    0
    • A abo el ror

      If a database is dettached and its log file (.ldf) has been deleted, I am trying to attach this database again , but i am facing some problems. Do someone have a solution for me ?

      M Offline
      M Offline
      Michael Potter
      wrote on last edited by
      #2

      The command is sp_attach_db. Example: EXEC sp_attach_db @dbname = N'pubs', @filename1 = N'c:\Program Files\Microsoft SQL Server\MSSQL\Data\pubs.mdf', @filename2 = N'c:\Program Files\Microsoft SQL Server\MSSQL\Data\pubs_log.ldf' I prefer using a backup/restore approach.

      A 1 Reply Last reply
      0
      • M Michael Potter

        The command is sp_attach_db. Example: EXEC sp_attach_db @dbname = N'pubs', @filename1 = N'c:\Program Files\Microsoft SQL Server\MSSQL\Data\pubs.mdf', @filename2 = N'c:\Program Files\Microsoft SQL Server\MSSQL\Data\pubs_log.ldf' I prefer using a backup/restore approach.

        A Offline
        A Offline
        Anonymous
        wrote on last edited by
        #3

        Thank you my friend, but my problem is that the Log.ldf file is not found (deleted), so @filename2 is invalid. Do you have another way ?

        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