→ Having trouble accessing our new support portal or creating a ticket? Please notify our team here

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
nnewton
Engaged Sweeper III
What is the WMI query that is used to list the databases on an SQL server?

We have a number of SQL installations but one of them (SQL Express 2008 R2) is not listing any databases. LANSweeper finds the instances fine, but the database section is empty.

I would like to run the WMI manually on the server to see if I can list the the databases that way and compare the results to a known good SQL server.

Thanks
1 ACCEPTED SOLUTION
Michael_V
Champion Sweeper III
dbpath = "Win32_PerfRawData_" + a suffix depending on the instance name.

"select dataFilesSizeKb, logFilesSizeKb, logFilesUsedSizeKb, Name from " + dbPath + " where name != \"_Total\""

You can try repairing the .mof files on your sql server first: http://www.lansweeper.com/kb/37/SQL-server-not-detected.html

View solution in original post

4 REPLIES 4
kraton
Engaged Sweeper
I have the same issue.

Only if I recsan the asset the SQL server information becomes visible.

Repairing the mof-files does not help.

How can I list the databases without an rescan? I need this information for an SQL-Report.

Thanks
stiwa
Champion Sweeper
Try repairing the .mof files as Michael mentioned, worked for me too.
nnewton
Engaged Sweeper III
Thanks. That works on the server and I can see all the databases with WMI Explorer so I'm not sure why LANSweeper is not seeing them.
Michael_V
Champion Sweeper III
dbpath = "Win32_PerfRawData_" + a suffix depending on the instance name.

"select dataFilesSizeKb, logFilesSizeKb, logFilesUsedSizeKb, Name from " + dbPath + " where name != \"_Total\""

You can try repairing the .mof files on your sql server first: http://www.lansweeper.com/kb/37/SQL-server-not-detected.html