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, 1214👍, 0💬
Popular Posts:
How To Turn on mysql Extension on the PHP Engine in MySQL? The "mysql" API extension is provided as ...
How To Get a List of All Tables with "sys.tables" View in SQL Server? If you want to see the table y...
How To Enter Unicode Character String Literals in SQL Server Transact-SQL? Unicode characters are mu...
How To Run SQL Commands in SQL*Plus in Oracle? If you want to run a SQL command in SQL*Plus, you nee...
How To Use SQL*Plus Built-in Timers in Oracle? If you don't have a stopwatch/timer and want to measu...