O'Reilly logo

Writing Stored Procedures for Microsoft SQL Server by Matthew Shepker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required