SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Member
    Join Date
    Feb 2005
    Location
    Lake District
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Cannot Import SQL File

    Hello,

    I have successfully uploaded and accessed Web Data Administrator but I cannot import the dorknozzle.sql file to it. When I attempt to do so (as the book describes on page 178) I get an error message stating:

    There was an error importing the database. The status of the import is unknown.

    Device activation error. The physical file name 'C:\Program Files\Microsoft SQL Server\MSSQL\data\Dorknozzle.mdf' may be incorrect.
    CREATE DATABASE failed. Some file names listed could not be created. Check previous errors.

    Why is this happening and why does it give the path name 'C:\Program Files\Microsoft SQL Server\MSSQL\data\Dorknozzle.mdf' when I import from C:\Dorknozzle.sql

    Thanks,
    badger

  2. #2
    SitePoint Addict danfran's Avatar
    Join Date
    Jan 2005
    Location
    New York City
    Posts
    244
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I can't say that I know 100% what's going on here, but generally, .sql files contain runnable SQL code, not databases..

    Take a look in your .sql file and show us the first few lines. (use Notepad or WordPad to open it.)

    Can you tell us the nature of the state of your current database? ..whether or not you can start with a blank db, if you already have data in a db that you need to preserve, etc..

    Dan

  3. #3
    SitePoint Member
    Join Date
    Feb 2005
    Location
    Lake District
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello,

    The first few lines of the .sql file are as follows:

    /* Generated by Web Data Administrator on 1/26/2004 3:55:23 PM */

    /* Options selected: database drop-commands table-schema table-data stored-procedures comments */

    /****** Object: Database Dorknozzle Script Date: 1/26/2004 3:55:23 PM ******/
    IF EXISTS (SELECT name FROM master.dbo.sysdatabases WHERE name = N'Dorknozzle')
    DROP DATABASE [Dorknozzle]
    GO

    CREATE DATABASE [Dorknozzle] ON (NAME = N'Dorknozzle_dat', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL\data\Dorknozzle.mdf' , SIZE = 2, FILEGROWTH = 10%) LOG ON (NAME = N'Dorknozzle_log', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL\data\Dorknozzle.ldf' , SIZE = 1, FILEGROWTH = 10%)
    COLLATE SQL_Latin1_General_CP1_CI_AS

    All I'm doing is following the Sitepoint Build Your Own ASP.NET website book to the letter. I've been successful so far and only come stuck at page 178, Importing a Database into MSDE. The book states:

    1. Select Import from the Web Data Administrator Navigator Menu (which I do)

    2. Browse for the Doeknozzle.sql file and click open (which I do)

    3. Select Import. (which I do) the book goes on to say "wait a few moments for the database to be recreated within Web Data Administator. You will receive a green success message. Unfortunately I get a red fail message as described in my initial post.

    Thanks in anticipation for your help.

    Regards,
    Mike

  4. #4
    SitePoint Addict danfran's Avatar
    Join Date
    Jan 2005
    Location
    New York City
    Posts
    244
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Device activation error. The physical file name 'C:\Program Files\Microsoft SQL Server\MSSQL\data\Dorknozzle.mdf' may be incorrect.
    That place (directory path on drive C) must exist on your computer! (don't make an mdf file, though) Simply find where your installation of Microsoft SQL Server is and change the path appropriately.

    MDFs and LDFs are the actual files that comprise the database you are trying to create. Both together are sorta like an Access MDB file in that "it's the actual database file"..

    First, let's get this path sorted out. -Don't forget to change the LDF path, too..

    If you have further problems, after fixing the paths, just go ahead and post, attach, or PM me the entire .sql file.

    -Dan

  5. #5
    SitePoint Member
    Join Date
    Feb 2005
    Location
    Lake District
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    I've located where the files have gone to. In the following folder:-

    C:\Program Files\Microsoft SQL Server\MSSQL$NETSDK\Data

    I have a dorknozzle.mdf and a drknozzle_log.ldf file. The 4 sample web data administrator files reside in there also. Why am I seeing the $NETSDK appendage?

  6. #6
    SitePoint Addict danfran's Avatar
    Join Date
    Jan 2005
    Location
    New York City
    Posts
    244
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, SQL Server (or some version of it, maybe MSDE) was obviously included as part of your .NET Software Development Kit installation..

    Problem solved?

    Dan

    edit:
    Dude, I have to say, I got a kick outta the name of yer db.. WTF is a dork-nozzle?
    Last edited by danfran; Feb 10, 2005 at 14:59.

  7. #7
    SitePoint Member
    Join Date
    Feb 2005
    Location
    Lake District
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Blame Zak for the name - i'm following a lesson. By the wat amigo keep walking the trail at www.walkingenglishman.com


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
  •