I am trying to run the following query against any one of our SQL database servers.
select
d.name 'database',
SUM(m.size)'size_mb'
from
sys.master_files m
left outer join
sys.databases d
on m.database_id = d.database_id
WHERE d.state = 0---ONLINE
GROUP BY
d.name
I using the SQL user experience to try and create a new template and I am getting the following error.
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
I have tried several different username and passwords that have rights to login and run a query on the SQL server but nothing I have tried works.
I am doing this because the RPC object for database size is returning the size in KB and we need this to be in MB which is what the query is suppose to do list all the databases and then return the size in MB.
I have opened a support ticket 188299 but that has not helped when they refer me to these 2 posts and say they don't know SQL any better then I do which is not very helpfull since I am not a SQL guru at all.
http://blogs.msdn.com/b/sql_protocols/archive/2005/10/22/483684.aspx
http://blogs.msdn.com/b/sql_protocols/archive/2005/10/29/486861.aspx
I am able to connect to the database from outside of Orion just fine, I am getting this error on all our SQL servers even my Orion server. I am hoping someone around here has found a way to run a SQL query in APM and can either talk me through how and where to set this up or can upload a shared template.
Thanks for any help.