Writing the Required C Code

Before you proceed too much further into this chapter, you need to be aware that this isn't a book on the C language. There is some C code presented only as an example. In this chapter, you won't learn how to write C code, and the code won't receive more than a cursory explanation .

Now that we are through that, it's time to jump into the actual creation of extended stored procedures. In C terms, the DLL contained in an extended stored procedure is a function with the following prototype:

SRVRETCODE xp_extendedProcName (SRVPROC *);

This function is exported by the compiler that you use to create the DLL and then registered with the SQL Server.

Note

When you are creating the C code required for your extended ...

Get Writing Stored Procedures for Microsoft SQL Server now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.