I need my (console) app to get some general SQLserver DB info.
In SQLserver management studio I run this query on the master system database:
SELECT @@VERSION, name, physical_name, size, SERVERPROPERTY('Edition'), SERVERPROPERTY('ProductVersion'), SERVERPROPERTY('MachineName')
FROM sys.master_files
WHERE name = 'mydb'
I get back a table with a single row and the values I need in 7 columns
How do I do this from EFcore ?
I understand I need to use ExecuteSqlRaw as I don't have and don't want a DBContext, however I am not sure
- how to execute it on the master system table ? and
- how to get the results ? (as strings is fine)
Any help appreciated
I ended up solving this like this: