SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Thread: SQL7.0 DB help

Hybrid View

  1. #1
    SitePoint Evangelist
    Join Date
    Jun 2001
    Location
    London
    Posts
    423
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy SQL7.0 DB help

    I have copied the data and log files from SL7.0 from one PC and saved them to CD.

    When rebuilding the PC I resaved them into the correct 'Data' folder assuming SQL7.0 would recognise them upon opening. Alas no. Anyone any ideas?

    Cheers

  2. #2
    I'm NOT an Addict ! TheRock's Avatar
    Join Date
    Jul 2001
    Location
    Earth ... maybe
    Posts
    401
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I personally have no idea there...

    But other good sites for SQL7.0 include www.dbforums.com -- maybe you can get an idea or two there...
    -*-
    B-School Forums - GMAT / MBA / Admissions discussions
    -*-

  3. #3
    SitePoint Enthusiast
    Join Date
    Mar 2000
    Posts
    93
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I personally would have backed up the database, copy backup file to CD then on the new box created a database and restored from CD file.

    However something tells me you have no access to the original database anymore - just the files.

    So, I guess check out CREATE DATABASE - expecially the FOR ATTACH parameters.

    Eh, hope there is a FOR ATTACH option in SQL 7 - as I am using SQL 2000.
    Stefan
    http://www.aspcode.net - articles on ASP/ASP.NET
    http://www.findfreefonts.net - jquery/ajax experiment site

  4. #4
    SitePoint Zealot
    Join Date
    Oct 1999
    Location
    France
    Posts
    141
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have a look in SQL Server's Books Online help for sp_attach_db. This will let you re-attach the files to the new server.

    Extra tip: make sure the files didn't get made read-only when you copied them to CD!

    HTH

    Veronica

  5. #5
    There can be only One.... joelwills's Avatar
    Join Date
    Jul 2000
    Location
    England
    Posts
    201
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The biggest problem I see is the read-only one which veronicay rightly points out. Check that this is not read only, then in SQL Query Analyzer use:
    Code:
    sp_attach_db @dbname = 'dbname', @filename1='c:\dbfilelocation\name.mdf', @filename2='c:\logfilelocation\name.ldf'
    However, did you use sp_detach_db before you copied the files to the CD? If not, and it's not a read-only problem, then unfortunately you might have no way of accessing the db.
    Life Goggles - The Entertaining Environment Blog
    http://www.lifegoggles.com

  6. #6
    SitePoint Zealot
    Join Date
    Oct 1999
    Location
    France
    Posts
    141
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Joel's reply is spot-on -- I was too lazy to look up the exact syntax!

    If the source SQLServer wasn't running when you copied the db files (i.e. it was stopped), you should be OK even if you didn't use sp_detatch_db.

  7. #7
    SitePoint Evangelist
    Join Date
    Jun 2001
    Location
    London
    Posts
    423
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cheers guys.....worked a treat!!!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •