Quantcast
Viewing all articles
Browse latest Browse all 15889

wmi query in case of sql named instance

Hi

I have a piece of c++ code that connects to sccm server. What i do is that i run WMI query ( SMS_SCI_SiteDefinition) to get the host and database name and then use SQLDriverConnect function to connect to SCCM. It works fine but the problem is if SQL server has named instance ...

In that case it returns server name as e.g 'srvname' and database name with instance name e.g. 'instance\dbname', which is other than what sqldriverconnect expects, it requires 'srvname\instance'(with instance) as server name and 'dbname'(with out instance) as database name. Can you tell me why wmi returns wrong database name? or is there a work around?

thanks


Viewing all articles
Browse latest Browse all 15889

Trending Articles