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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Need help with strange behavior of SQL Server Express

Need help with strange behavior of SQL Server Express

Scheduled Pinned Locked Moved Database
databasesql-serversysadminhelpquestion
3 Posts 2 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.
  • J Offline
    J Offline
    James Shao
    wrote on last edited by
    #1

    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\Website\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\Website\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. :confused: 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! :omg: 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. :confused: Could you guys please help me out? I'd greatly appreciate it. Thanks!!

    T 1 Reply Last reply
    0
    • J James Shao

      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\Website\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\Website\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. :confused: 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! :omg: 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. :confused: Could you guys please help me out? I'd greatly appreciate it. Thanks!!

      T Offline
      T Offline
      T2102
      wrote on last edited by
      #2

      You should not delete MDF and LDF database files. You should only tell the database to limit log file sizes and shrink the log file if it is already too big.

      J 1 Reply Last reply
      0
      • T T2102

        You should not delete MDF and LDF database files. You should only tell the database to limit log file sizes and shrink the log file if it is already too big.

        J Offline
        J Offline
        James Shao
        wrote on last edited by
        #3

        Thank you Ted, though I'm still confused about why in SQL Server Management Studio, it shows that it's pointing to the database under the VWD folder rather than the C:\ folder, and when I delete the files in the C:\ folder, I don't see them anymore in SQL Server Management Studio? :zzz:

        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