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, 1453🔥, 0💬
Popular Posts:
How To Convert Characters to Numbers in Oracle? You can convert characters to numbers by using the T...
How To Drop a Stored Procedure in Oracle? If there is an existing stored procedure and you don't wan...
How To Use DATEADD() Function in SQL Server Transact-SQL? DATEADD() is a very useful function for ma...
What Are the Underflow and Overflow Behaviors on FLOAT Literals in SQL Server Transact-SQL? If you e...
How To Get Year, Month and Day Out of DATETIME Values in SQL Server Transact-SQL? You can use DATEPA...