Where does SQL Server 2005 keep the .mdf files?
I'm upgrading from SQ开发者_运维百科L Server 2005 to 2008. I've detached the database I need, but can't find it on the file system.
Where does a default installation of SQL Server 2005 store these?
You can also use management studio to look at the properties>files of any database - that will show the files and their growth settings.
try this, run this query
use model
go
SELECT physical_name FROM sys.database_files
in my case on my laptop it is in this folder
C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\
By default, in \Program Files\Microsoft SQL Server\
The default locations for SQL Server 2005 are:
- \Microsoft SQL Server\MSSQL.1\MSSQL\ for the Database Engine
- \Microsoft SQL Server\MSSQL.2\OLAP\ for Analysis Services
- \Microsoft SQL Server\MSSQL.3\RS\ for Reporting Services
See HERE for more details.
Sometimes you can't look at the properties if one of the systems files is corrupt.
you can always go to SQL Server Management Studio and right click on the database, than select proprieties, than go on the angle Files, you will see two files displayed in a table on is MDF file and Log file , check the path ! go to that folder, your database is the MDF file !
PS : to be able to copy i think you have to terminate the SqlServer Processes, that's a little dirty way isn't, but it's fast and i use it, works for me !
Go to C Drive --> Program Files --> Microsoft SQL Server --> MSSQLXX --> MSSQL -- > DATA
The Data Folder has mdf and log files both.
You should probably do a database export from management studio so there aren't any compatibility issues.
精彩评论