Very often DBAs need to find the location of the physical file (MDF, LDF & NDF) of a database. Simply we can obtain the output by executing the below query. Run the script to get the SQL Server database file location for all the databases for a particular instance.
1 2 3 |
SELECT DBS.name as [Database], DBM.name as [File Name], DBM.physical_name as [File Location] from sys.databases DBS inner join sys.master_files DBM ON DBS.database_id = DBM.database_id WHERE DBS.database_id>4 |
Recently we moved whole on-premises resources to the cloud. In an easy word, we have moved SQL Server from on-premises…
In SQL Server sp_send_dbmail use to send emails and the SQL Server log all the status of each message processed…