Where is my database stored on the hard disk in MS SQL Server?
Submitted by: AdministratorIf a database is created with simple CREATE DATABASE statement, the server will create two database files on the hard disk to store data and configuration information about that data bases:
* database_name.mdf - SQL Server Database Primary Data File
* database_name_log.ldf - SQL Server Database Transaction Log File
To find out the location of database files, you can query the "sys.database_files" view as shown in this tutorial example:
USE GlobalGuideLineDatabase
GO
SELECT type_desc, physical_name, size
FROM sys.database_files
GO
type_desc physical_name size
ROWS c:Program FilesMicrosoft SQL Server
MSSQL.1MSSQLDATAGlobalGuideLineDatabase.mdf 152
LOG c:Program FilesMicrosoft SQL Server
MSSQL.1MSSQLDATAGlobalGuideLineDatabase_log.LDF 63
Go verify these two files with Windows Explorer.
Submitted by: Administrator
* database_name.mdf - SQL Server Database Primary Data File
* database_name_log.ldf - SQL Server Database Transaction Log File
To find out the location of database files, you can query the "sys.database_files" view as shown in this tutorial example:
USE GlobalGuideLineDatabase
GO
SELECT type_desc, physical_name, size
FROM sys.database_files
GO
type_desc physical_name size
ROWS c:Program FilesMicrosoft SQL Server
MSSQL.1MSSQLDATAGlobalGuideLineDatabase.mdf 152
LOG c:Program FilesMicrosoft SQL Server
MSSQL.1MSSQLDATAGlobalGuideLineDatabase_log.LDF 63
Go verify these two files with Windows Explorer.
Submitted by: Administrator
Read Online MS SQL Server Job Interview Questions And Answers
Top MS SQL Server Questions
☺ | What Is a Transact-SQL Statement Batch in MS SQL Server? |
☺ | What Happens If Strings Are Casted into Wrong Code Pages in MS SQL Server? |
☺ | How To Write Character String Constants or Literals in MS SQL Server? |
☺ | How To Convert a Numeric Expression from One Data Type to Another? |
☺ | How To Concatenate Two Binary Strings Together? |
Top Databases Programming Categories
☺ | RDBMS Interview Questions. |
☺ | SQL Interview Questions. |
☺ | SSRS Interview Questions. |
☺ | Database Administrator (DBA) Interview Questions. |
☺ | Sybase Interview Questions. |