Content Supported by Sourcelens Consulting

<!--TO READ THIS HELP FILE, RIGHT-CLICK ON THE FILE NAME IN THE
    SOLUTION EXPLORER PANE AND SELECT "VIEW IN BROWSER"-->

<html><head><title>YukonCLR Sample: Upgrading Stored Procedures to Work with SQL Server 2005</title></head><body><h1>YukonCLR Sample: Upgrading Stored Procedures to Work with SQL Server 2005</h1><div id="mainSection"><div id="mainBody"><div id="allHistory" class="saveHistory" onsave="saveAll()" onload="loadAll()"></div><p /><p>This sample demonstrates how to leverage an existing extended stored procedure and how to use C++ for developing CLR code. It comprises two solutions:</p><ul><li><p>CppXP2Clr, which contains two projects:</p><ul><li><p>xp_cheksum, an extended stored procedure with C++ functions</p></li><li><p>clr_checksum, a port using CLR pure</p></li></ul></li><li><p>CppUdt is a CLR safe SQL Server 2005 project that contains user-defined data type</p></li></ul><div class="alert"><table width="100%" cellspacing="0" cellpadding="0"><tr><th align="left">Security Note </th></tr><tr><td><p>This sample code is provided to illustrate a concept and should not be used in applications or Web sites, as it may not illustrate the safest coding practices.</p></td></tr></table></div><h1 class="heading">To build the sample</h1><div id="procedureSection0" class="section"><ul><li><p>On the <b>Build</b> menu, select the <b>Build Solution</b> menu item.</p></li></ul></div><h1 class="heading">To run the sample</h1><div id="procedureSection1" class="section"><ul><li><p>On the <b>Debug</b> menu, select the <b>Start</b> menu item.</p></li></ul></div><h1 class="heading">Requirements</h1><div id="requirementsSection" class="section"><p>This sample requires the AdventureWorks sample database on a SQL Server 2005 server. After you load a SQL Server Class Library application in the Visual Studio integrated development environment (IDE), a message box will prompt you to specify connection information to a SQL Server. For this sample application, specify the AdventureWorks database.</p></div><h1 class="heading">Demonstrates</h1><div id="demonstratesSection" class="section"><p>How to:</p><ul><li><p>Use an existing extended stored procedure</p></li><li><p>Move existing stored procedure functions to SQL Server 2005</p></li><li><p>Use new user-defined data types in SQL Server 2005</p></li></ul></div><h1 class="heading">How it Works</h1><div id="sectionSection0" class="seeAlsoNoToggleSection"><p>Yukon/CLR consists of two solutions, CppXP2Clr and CppUdt.</p><p>Solution CppXP2Clr consists of two projects, an extended stored procedure and a SQL Server Class Library project. The SQL/CLR project demonstrates the simplicity of moving native C++ function to SQL/CLR. The function checksum() will be used in both projects. The SQL/CLR project will be built using /clr:pure to leverage existing C++ functions.</p><p>Solution CppUdt is a SQL/CLR project built with /clr:safe and creates a user-defined data type (UDT). This project demonstrates using C++/CLI to build SQL/CLR project with UDT.</p></div></div><div id="footer"><div class="footerLine"></div>
          © Microsoft Corporation. All rights reserved.  Send <a href="mailto:DevDocs@microsoft.com?subject=Documentation Feedback :YukonCLR Sample: Upgrading Stored Procedures to Work with SQL Server 2005">comments</a> about this topic to Microsoft.
      </div></div></body></html>