Collections:
Location of Database Files in SQL Server
Where is my database stored on the hard disk in SQL Server?
✍: FYIcenter.com
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:
To find out the location of database files, you can query the "sys.database_files" view as shown in this tutorial example:
USE FyiCenterData
GO
SELECT type_desc, physical_name, size
FROM sys.database_files
GO
type_desc physical_name size
ROWS c:\Program Files\Microsoft SQL Server
\MSSQL.1\MSSQL\DATA\FyiCenterData.mdf 152
LOG c:\Program Files\Microsoft SQL Server
\MSSQL.1\MSSQL\DATA\FyiCenterData_log.LDF 63
Go verify these two files with Windows Explorer.
⇒ Creating Databases with Specified Physical Files in SQL Server
⇐ Getting a List of All Databases on the Server in SQL Server
2016-11-24, 2351🔥, 0💬
Popular Posts:
What Happens to Your Transactions When ERROR 1205 Occurred in MySQL? If your transaction receives th...
How To Create a Dynamic Cursor with the DYNAMIC Option in SQL Server Transact-SQL? If the underlying...
Where to find answers to frequently asked questions on Storage Engines: MyISAM, InnoDB and BDB in My...
Where to find answers to frequently asked questions on Storage Engines: MyISAM, InnoDB and BDB in My...
How To Change the Name of a Database User in SQL Server? If you want to change the name of an existi...