Stored Procedures are saved to a database by executing the text of the
Stored Procedure as if it were an ODBC command. They are "run" by executing
the name of the Stored Procedure and adding any parameters ("call
<procedure name>").
ODBC Script commands are saved to local storage, not in a database. ODBC
Scripts are "run" by simply executing the commands they contain.
Saving a Stored Procedure requires work to remove the existing Stored
Procedure before the updated one is saved. Visual InterDev does this work
when a Stored Procedure is saved from within the Stored Procedure Editor.
It does no special work when an ODBC Script is run, and so the second time
a Stored Procedure inside an ODBC Script is run fails because the Stored
Procedure already exists in the database.
Steps to Reproduce Behavior
- Create a database project or add a data connection to a Web project.
- Click the Data View tab in the Workspace window.
- Select the Data connection to which to add a Stored Procedure in the
Data View window.
- From the File menu, select New. Click ODBC Script File.
- Enter the text "Create Procedure MyProc as return" in the ODBC Script window (without the quotes).
- Right-click in the window and select Run.
NOTE: Repeating step 6 fails at this point.
- Right-click the data connection sub-folder of the Workspace Window and select Refresh.
- Expand the Data connection sub-folder.
- Expand the Stored Procedures folder.
- Double-click the new Stored Procedure sub-folder to open it for editing.