SQL SERVER – Find Location of Data File Using T-SQL

A short T-SQL script that finds where your SQL Server Data File folder is on disk, using master.sys.master_files. Handy when you forget where the files live.