database SQL Server 2005 将 .mdf 文件保存在哪里?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3498342/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Where does SQL Server 2005 keep the .mdf files?
提问by kirk.burleson
I'm upgrading from SQL Server 2005 to 2008. I've detached the database I need, but can't find it on the file system.
我正在从 SQL Server 2005 升级到 2008。我已经分离了我需要的数据库,但在文件系统上找不到它。
Where does a default installation of SQL Server 2005 store these?
SQL Server 2005 的默认安装在哪里存储这些?
采纳答案by Sam
You can also use management studio to look at the properties>files of any database - that will show the files and their growth settings.
您还可以使用 management studio 查看任何数据库的属性>文件 - 这将显示文件及其增长设置。
回答by SQLMenace
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\
C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\
回答by SLaks
By default, in \Program Files\Microsoft SQL Server\
默认情况下,在 \Program Files\Microsoft SQL Server\
回答by JBrooks
The default locations for SQL Server 2005 are:
SQL Server 2005 的默认位置是:
- \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
- \Microsoft SQL Server\MSSQL.1\MSSQL\ 用于数据库引擎
- \Microsoft SQL Server\MSSQL.2\OLAP\ 用于分析服务
- \Microsoft SQL Server\MSSQL.3\RS\ 用于 Reporting Services
See HEREfor more details.
有关更多详细信息,请参见此处。
Sometimes you can't look at the properties if one of the systems files is corrupt.
有时,如果系统文件之一损坏,您将无法查看属性。
回答by KADEM Mohammed
you can always go to SQL Server Management Studioand 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 MDFfile and Logfile , check the path! go to that folder, your database is the MDF file!
你可以随时进入SQL Server Management Studio并右键单击数据库,然后选择属性,然后转到角度文件,你会看到两个文件显示在一个表格中,一个是MDF文件,另一个是日志文件,检查路径!转到该文件夹,您的数据库是MDF 文件!
PS : to be able to copy i think you have to terminate the SqlServerProcesses, that's a little dirty way isn't, but it's fast and i use it, works for me !
PS:为了能够复制,我认为你必须终止SqlServer进程,这有点脏,但它很快,我使用它,对我有用!
回答by Gaurav
Go to C Drive --> Program Files --> Microsoft SQL Server --> MSSQLXX --> MSSQL -- > DATA
转到 C 驱动器 --> 程序文件 --> Microsoft SQL Server --> MSSQLXX --> MSSQL --> 数据
The Data Folder has mdf and log files both.
数据文件夹有 mdf 和日志文件。
回答by Byron Whitlock
You should probably do a database export from management studio so there aren't any compatibility issues.
您可能应该从管理工作室进行数据库导出,这样就不会有任何兼容性问题。