Access Plans and Bind Files

Embedded SQL for C and SQL Server

Embedded SQL for C and SQL Server

Access Plans and Bind Files

The static SQL statements of an application can be issued at run time (as are dynamic SQL statements), or they can be placed into an access plan. An access plan is a set of stored procedures. It includes a separate stored procedure for each static SQL statement.

Using the nsqlprep precompiler, you can connect to a specified server and database and create an access plan. Each time an application is recompiled, old stored procedures with the same program module name are dropped.

If the database you need to connect to is unavailable when you are ready to compile, you can use the nsqlprep precompiler to create a bind file. A bind file is a Transact-SQL script used to create stored procedures for the access plan. You can later use the Microsoft® SQL Server™ 2000 isql utility to apply the bind file to the database before you run the application.