Announcements
hello
I need to know how can i get all database applicaction and all databases systems installed on Dynamics SL 2011 by SQL query.
I make the query: "select * from sys.databases", and I get all databases installed on my server.
but I don't know wich data can make the filter to get by type (system or application)
I need this result:
System:
Application:
Thanks vey much
Greetings.
*This post is locked for comments
There's no single query to produce this. You've got to have some scripting or procedure as far as I know. This because of MSSQL design.
Having said so, there are some macro oriented sp built in SQL. The closest thing to a one liner may be something like:
sp_msforeachdb 'select distinct "?" AS dbsys, DatabaseName as dbapp from [?].dbo.Company'
This will produce sys database and app database matching pairs along with an awful lot of errors. If you are using SQL Mgmt Studio, set the outoput to text for beter results. Beware that we are not really scanning APP databases, they appear in the result because they are mentioned by SYS ones. In your case, the output would be something like:
Invalid object name 'TELDATAAPP.dbo.Company'. dbsys dbapp -------- ------------------------------ IEXPSYS 0101CONSTRUCAPP Invalid object name '0101CONSTRUCAPP.dbo.Company'. dbsys dbapp ------ ------------------------------ SYSVT TELDATAAPP
André Arnaud de Cal... 291,359 Super User 2024 Season 2
Martin Dráb 230,370 Most Valuable Professional
nmaenpaa 101,156