Results 1 to 2 of 2

Thread: Strange behavior in SQL Server

  1. #1
    Join Date
    Nov 2009
    Posts
    1

    Question Strange behavior in SQL Server

    I work with both SQL Server Express 2008 and Microsoft Visual Web Studio Express 2008. However the two programs don't seem to be "in sync" properly.

    Probably this is because I set up the database wrong, but I'm not sure. I first add a new database and a table in VWD (Visual Web), which creates two files, a MDF and a log file under
    Documents\VisualWebStudio2008Express\Websites\Webs ite\APP folder.

    Next, I tried attaching that database file in SQL Server Management Studio Express. Since the Express version could not access any document saved under My Documents (which I later found out), I copied the two files and pasted them directly under my C:\ directory, and successfully attached the database into SQL Server Management by pointing its path to the database under C:\.

    Now here's where all the weird things started happening.

    1. The file path of the newly attached database in SQL Server Management Studio shows that it's now pointing to
    Documents\VisualWebStudio2008Express\Websites\Webs ite\APP folder
    instead of C:\, which was where I originally pointed to. Hmm, strange...

    2. To test it out, I inserted some data into the database via SQL Server, and when going back to VWD and opening up the table, surprisingly the file is updated accordingly.

    3. Thinking that I wouldn't need the two files in C:\ anymore, I deleted them. But now going back to SQL Server, I found that the database is now gone! mg: Of course in VWD I could still open the database because it's pointing to the file under Documents\VisualWebStudio....

    This is all very confusing, and I couldn't figure out what's pointing at what actually.

    Could you guys please help me out? I'd greatly appreciate it.

    Thanks!!

  2. #2
    Join Date
    Sep 2002
    Posts
    5,938
    Attach the db with files in c:\ again and query sys.sysfiles, it may still has path generated by VWD. Can also try delete files from your profile.

Posting Permissions

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