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, 1817🔥, 0💬
Popular Posts:
What Happens If the UPDATE Subquery Returns Multiple Rows in MySQL? If a subquery is used in a UPDAT...
How To Find Out What Privileges a User Currently Has in Oracle? Privileges granted to users are list...
What Is SQL*Plus in Oracle? SQL*Plus is an interactive and batch query tool that is installed with e...
How To Update Multiple Rows with One UPDATE Statement in SQL Server? If the WHERE clause in an UPDAT...
How to change the data type of an existing column with "ALTER TABLE" statements in SQL Server? Somet...