Returns the number of instances of Microsoft® SQL Server™ installed on a computer.
int NumInstalledInstances ( );
The function takes no parameters.
The number of instances of SQL Server installed on the computer.
Microsoft does not support more than 16 instances of SQL Server on a computer. Use NumInstalledInstances to check the number of existing instances of SQL Server on a computer before installing a new instance.
Desktop Engine Installation Sample