To write a .NET stored procedure (SP), user-defined function (UDF), or trigger, follow these steps after creating your solution and/or projects from the previous topic:
You may consider customizing the name of the .cs file that will be created. This name is not in any way associated with your stored procedure name.
Click OK.
A new source file is created. The class you implement is already prepared and you implement the ExecuteSP method with your application logic, as described later.
Once coded, your SP, UDF, or trigger needs to be compiled and “deployed” to a server. Right-click it in Solution Explorer and choose Deploy to Server. One or more SP, UDF, or triggers can be deployed at the same time.
You are notified if any problems are encountered while the code is compiled and deployed to a c-treeACE SQL server.
A stored procedure can be run to test its behavior by right-clicking in Solution Explorer and choosing Test Procedure. A window appears allowing you to set the stored procedure’s parameters, execute it, and see the result generated.
By right-clicking in Solution Explorer and choosing Debug Server it is possible to debug a SP, UDF, or trigger while the server runs it.
The server must be active and reachable while debugging. For simplicity, the server should be running on the same machine, although it is possible to debug a remote server using Microsoft remote debugger.
You can set a breakpoint in the code, launch a debug server (not necessarily in this sequence), and execute your stored procedure via external tools such as c-treeACE SQL Explorer, your own program, or Test Procedure as described above.