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. Web Development
  3. ASP.NET
  4. where are SQL server database files located?

where are SQL server database files located?

Scheduled Pinned Locked Moved ASP.NET
databasesql-serversysadminquestion
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.
  • S Offline
    S Offline
    Seraph_summer
    wrote on last edited by
    #1

    I am using SQL SERVER to create a database, but I can not find the files in my PC. if open it from SQL SERVER MANAGEMENT, it is shown as my-PC\SQLEXPRESS\database\system datatase\master\tables\dbo.TEST actually TEST is one table I CREATEED. but I CAN NOT FIND IT IN THE EXPLORER. who can tell me where is it located then? thanks.

    I C 2 Replies Last reply
    0
    • S Seraph_summer

      I am using SQL SERVER to create a database, but I can not find the files in my PC. if open it from SQL SERVER MANAGEMENT, it is shown as my-PC\SQLEXPRESS\database\system datatase\master\tables\dbo.TEST actually TEST is one table I CREATEED. but I CAN NOT FIND IT IN THE EXPLORER. who can tell me where is it located then? thanks.

      I Offline
      I Offline
      Ian McCaul
      wrote on last edited by
      #2

      First and foremost. Never add tables to the master database. Create a new database and add it there. For express the default data location is usually C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data. Also, you cannot see specific tables in Windows Explorer, only the databases.

      1 Reply Last reply
      0
      • S Seraph_summer

        I am using SQL SERVER to create a database, but I can not find the files in my PC. if open it from SQL SERVER MANAGEMENT, it is shown as my-PC\SQLEXPRESS\database\system datatase\master\tables\dbo.TEST actually TEST is one table I CREATEED. but I CAN NOT FIND IT IN THE EXPLORER. who can tell me where is it located then? thanks.

        C Offline
        C Offline
        Christopher Duncan
        wrote on last edited by
        #3

        I'm using the full version so there may be some differences in Express (I'm not familiar with that product). That said, one way to determine where your .mdf / .ldf files for your db are located is to script the database. Right click on the database you've created, select Script Database As from the popup menu. You may have to follow slightly different steps in Express, but the general idea here is to generate a CREATE DATABASE script. Having done so, you'll notice something along these lines: CREATE DATABASE [YourDbName] ON PRIMARY ( NAME = N'YourDbName', FILENAME = N'C:\Whatever\The\Path\Is\YourDbName.mdf' , SIZE = 45056KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )... There's more to the script of course, but the FILENAME portion will show you exactly where the db file lives. Sql Server uses .mdf files for the database, and .ldf for the log. If you want to move it to a new directory, be sure to move both files. Hope this helps -

        Christopher Duncan www.PracticalUSA.com Author of The Career Programmer and Unite the Tribes Copywriting Services

        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