SQL Script to find database details
2) Database ID
3) Database Files name with their physical location
4) Database Creation Time
5) Users access type for Database
6) Database recovery model
7) Database State (ON/OFF)
8) Database Collation
9) File size on the Disk
Following SQL Query will help you in finding the above mentioned information for all databases on a SQL Server
SELECT
sd.[Name] AS [database Name]
,sd.database_id [Database Id]
,mf.name as [File Logical Name]
,case
when type_desc = ‘LOG’ then ‘Log File’
when type_desc = ‘ROWS’ then ‘Data File’
Else type_desc
end as [File type]
,mf.physical_name [Physical Location]
,sd.create_date [Database Creation date]
,sd.collation_name [collation name]
,sd.user_access_desc [User Access Type]
,sd.recovery_model_desc [Database Recovery Model]
,sd.state_desc [Database State]
,size_on_disk_bytes [File Size in bytes]
,size_on_disk_bytes/ 1024 as [File Size in KB]
,size_on_disk_bytes/ 1024 / 1024 as [File Size in MB]
FROM sys.dm_io_virtual_file_stats(NULL, NULL) AS fs
inner join sys.databases sd on fs.database_id=sd.database_id
JOIN sys.master_files AS mf ON mf.database_id = fs.database_id
AND mf.file_id = fs.file_id
ORDER BY sd.database_id
I hope that above query will be helpful to you. Don’t forget to give your valuable comments on this article. Also you can send me your valuable feedback on my email id askvivekjohari@gmail.com
Awesome Very useful Article
Pingback: seo plan for website
Pingback: משלוחי סושי מבשרת ציון
Pingback: รักษาหลุมสิว
Pingback: Dentist in Victoria Tx
Pingback: ปล่อยเงินด่วน
Pingback: กู้ ซื้อ บ้าน ไม่ ผ่าน
Pingback: stump removal
Pingback: Dentist in Fresno California
Pingback: onion link directory
Pingback: Top Realtor Tallahassee
Pingback: hair transplant montreal
Pingback: 바카라
Pingback: เสือมังกรออนไลน์
Pingback: 바카라사이트
Pingback: ดูดไขมัน
Pingback: relaxing music
Pingback: ติดฟิล์มคอนโด
Pingback: google analytics wordpress
best casino game on this world Ligaz
Pingback: Dentist in Grand Rapids MI
Pingback: math tutoring beachwood
Pingback: a few of our recent reports
Pingback: ligaz24th.com
Pingback: con heo dat remix
Pingback: homes for sale in Twin Cities MN
Pingback: forum
Pingback: пелетни горелки|пелетни горелки Благоевград|пелетна горелка Грейко|самопочистващи пелетни горелки
Pingback: Samsara Market
Pingback: Darknet
Pingback: https://novushub.com/hindi-gana-video/