Deploying Applications with SQL Native Client

When deploying an application which is dependent on SQL Native Client, you will need to redistribute SQL Native Client with your application. Unlike Microsoft Data Access Components (MDAC), which is now a component of the operating system, SQL Native Client is a component of SQL Server 2005. Therefore, it is important to install SQL Native Client in your development environment and redistribute SQL Native Client with your application.

In addition to installing SQL Native Client as part of the SQL Server installation, there is also a redistributable installation program named sqlncli.msi, which can be found on the SQL Server 2005 installation media in the following location:


For 64-bit Windows on Windows (WOW64) installations, you must use the 64-bit SQL Native Client package, named sqlncli_x64.msi on the 32-bit installation disk and sqlncli.msi on the 64-bit installation disk.

This installation file can be used to install SQL Native Client directly from the SQL Server 2005 installation media, and it can also be used to freely distribute SQL Native Client with your own custom applications.

When a custom application is built that uses SQL Native Client, the custom application should indicate that it depends on SQL Native Client through the install option APPGUID. This enables the SQL Native Client installer to warn the user before uninstalling that applications may be broken if the component is removed. When multiple applications are installed on the same system which depends on SQL Native Client, the warning (enabled when using the install option APPGUID) ensures that no other application blindly uninstalls SQL Native Client thereby breaking the remaining applications.

To indicate to SQL Native Client your dependency, you must set the APPGUID command line parameter to your product code when silently installing SQL Native Client. For example:

msiexec /i sqlncli.msi APPGUID={0CC618CE-F36A-415E-84B4-FB1BFF6967E1}

As mentioned above, the APPGUID is set to your specific product code. A product code must be created when using Microsoft Installer to bundle your application setup program.

By default the SQL Native Client installer only installs the client components when installed independent of SQL Server 2005. To install all components (client and the SDK components), specify ADDLOCAL=All on the command line. For example:

msiexec /i sqlncli.msi ADDLOCAL=ALL APPGUID={0CC618CE-F36A-415E-84B4-FB1BFF6967E1}

See Also

Other Resources

SQL Native Client Programming

Help and Information

Getting SQL Server 2005 Assistance