I have SQL Server 2008 R2 in mind but I note that compared with
version 2005, C++ examples appear to have disappeared from the on-line
documentation for SQL Server 2008. Even if, unlike for VB and C#,
there are no templates for C++ development, still there perhaps is a
way to configure Visual Studio manually. I have pasted an example of a
stored procedure from here:
http://msdn.microsoft.com/en-us/library/zxsa8hkf(v=VS.90).aspx
but cannot build it. First of all, the compiler complains about
#include "stdafx.h" at the top, which I have commented out OK, but
then the code does not link (LINK : fatal error LNK1561: entry point
must be defined). What should the entry point be?
So, the idea is not to call native C++ from within another language
(looks like writing an extended stored procedure is the only way to
use C++ natively which is being deprecated) but use managed C++.
Thank you.
Paul
Created Visual C++ -> CLR -> Class Library project, having
selected .NET Framework 3.5, changed the Common Language Runtime
Support under Configuration Properties to /clr:safe, and was able to
add the compiled assembly DLL to SQL Server, whatever the entry point
was.
#include "stdafx.h" in the example was created by the wizard.