How to find the data files and log files for those not in the proper drives as per database standards?

Data file check

select name, physical_name from sys.master_files
where type = 0 and left(physical_name,12) <> 'A:\Data\SQL\'

Log file Check

select name,database_id, physical_name from sys.master_files
where type = 1 and left(physical_name,12) <> 'B:\Logs\SQL\'

If any records found for the above query,if so seems to be some of the datafiles and log files not following database standard.

We need to change mdf and ldf to the appropriate path.


Popular posts from this blog

SQL Server:Steps to Configure Database Mirroring by T-SQL Script.

SSIS2008R2 Error: 0xC0209303 at Package: