MSSQL%20Interview%20Questions%20and%20Answers
Question: Where is my database stored on the hard disk in MS SQL Server?Answer: If 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 withoutbookdb GO SELECT type_desc, physical_name, size FROM sys.database_files GO type_desc physical_name size ROWS c:Program FilesMicrosoft SQL Server MSSQL.1MSSQLDATAwithoutbookdb.mdf 152 LOG c:Program FilesMicrosoft SQL Server MSSQL.1MSSQLDATAwithoutbookdb_log.LDF 63 Go verify these two files with Windows Explorer. |
Is it helpful?
Yes
No
Most helpful rated by users:
- What is Microsoft SQL Server?
- What is the simplest way to create a new database in MS SQL Server?
- How to delete a database in MS SQL Server?
- How to download and install Microsoft .NET Framework Version 2.0?
- How To Get a List of Columns using the "sp_help" Stored Procedure in MS SQL Server?