<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="/rss.xsl"?><rss version="2.0"><channel><title>MSFTEngProdSamples Wiki &amp; Documentation Rss Feed</title><link>http://www.codeplex.com/MSFTEngProdSamples/Wiki/View.aspx?title=Home</link><description>MSFTEngProdSamples Wiki Rss Description</description><item><title>Updated Wiki: Home</title><link>http://msftengprodsamples.codeplex.com/wikipage?version=27</link><description>&lt;div class="wikidoc"&gt;&lt;a href="http://CodePlex.com/SqlServerSamples" class="externalLink"&gt;SQL Server Samples Portal Page&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; &amp;gt; SQL Server Database Engine Product Samples&lt;br /&gt;&lt;br /&gt;The Microsoft SQL Server Database Engine is the core service for storing, processing and securing data. The Database Engine provides controlled access and rapid transaction processing to meet the requirements of the most demanding data consuming applications within your enterprise. The Database Engine also provides rich support for sustaining high availability.&lt;br /&gt;&lt;br /&gt;This project contains Engine samples released with Microsoft SQL Server product. Below is the list of these samples. If you are interested in contributing Engine samples, please let us know by posting in the developers' forum.&lt;br /&gt;&lt;br /&gt;To download these samples click on the Releases tab (or click &lt;a href="https://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=MSFTEngProdSamples" class="externalLink"&gt;here&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;), optionally select another (older) release, then click on the Windows Installer package (MSI file) which matches the architecture of the installation computer.&lt;br /&gt;&lt;br /&gt;For information about how to use CodePlex to access SQL Server samples, click &lt;a href="http://www.codeplex.com/SqlServerSamples/Wiki/View.aspx?title=HowToUseCodePlex&amp;amp;referringTitle=Home" class="externalLink"&gt;here&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;br /&gt;To download samples databases, click &lt;a href="http://www.codeplex.com/MSFTDBProdSamples/Release/ProjectReleases.aspx" class="externalLink"&gt;here&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; and then click the appropriate MSI file.&lt;br /&gt;For release notes and brief descriptions of all the sample databases and code, including restrictions on SQL Express and Vista, click &lt;a href="http://www.codeplex.com/SqlServerSamples/Wiki/View.aspx?title=SQLServerDatabasesandSamplesOverview&amp;amp;referringTitle=Home" class="externalLink"&gt;here&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;br /&gt;&lt;table&gt;&lt;tr&gt;&lt;th&gt; Sample &lt;/th&gt;&lt;th&gt; SQL Server 2005 &lt;/th&gt;&lt;th&gt; SQL Server 2008 &amp;amp; SQL Server 2008R2 &lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; Data Warehouse Tuning Techniques Sample &lt;/td&gt;&lt;td&gt; n/a &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21Data%20Warehouse%20Tuning%20Techniques%20Sample&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; Grouping Sets Report &lt;/td&gt;&lt;td&gt; n/a &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21Grouping%20Sets%20Report&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;
&lt;h3&gt;&lt;b&gt;CLR&lt;/b&gt;&lt;/h3&gt;&lt;table&gt;&lt;tr&gt;&lt;th&gt; Sample &lt;/th&gt;&lt;th&gt; SQL Server 2005 &lt;/th&gt;&lt;th&gt; SQL Server 2008 &amp;amp; SQL Server 2008R2 &lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; AdventureWorks Cycles CLR Layer &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2005%21AdventureWorks%20Cycles%20CLR%20Layer&amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21AdventureWorks%20Cycles%20CLR%20Layer&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; Array Parameter Sample &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2005%21Array%20Parameter%20Sample&amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21Array%20Parameter%20Sample&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; Assembly Cleanup Sample &lt;/td&gt;&lt;td&gt; n/a &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21Assembly%20Cleanup%20Sample&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; Calendar-Aware Date/Time UDTs &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2005%21Calendar-Aware%20Date%2fTime%20UDTs&amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21Calendar-Aware%20Date%2fTime%20UDTs&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; Currency Web Service Sample &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2005%21Currency%20Web%20Service%20Sample&amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21Currency%20Web%20Service%20Sample&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; Hello World Ready Sample &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2005%21Hello%20World%20Ready%20Sample&amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21Hello%20World%20Ready%20Sample&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; Hello World Sample &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2005%21Hello%20World%20Sample&amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21Hello%20World%20Sample&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; Impersonation Sample &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2005%21Impersonation%20Sample&amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; n/a &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; In-Process Data Access Sample &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2005%21In-Process%20Data%20Access%20Sample&amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21In-Process%20Data%20Access%20Sample&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; Large Binary Object (LOB) Handling &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2005%21Large%20Binary%20Object%20%28LOB%29%20Handling&amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21Large%20Binary%20Object%20%28LOB%29%20Handling&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; Oracle TVF Sample &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2005%21Oracle%20TVF%20Sample&amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21Oracle%20TVF%20Sample&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; Result Set Sample &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2005%21Result%20Set%20Sample&amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21Result%20Set%20Sample&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; Send DataSet Sample &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2005%21Send%20DataSet%20Sample&amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21Send%20DataSet%20Sample&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; Spatial Sample &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2005%21Spatial%20Sample&amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21Spatial%20Sample&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; String Split Table-Valued Function (TVF) &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2005%21String%20Split%20Table-Valued%20Function%20%28TVF%29&amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21String%20Split%20Table-Valued%20Function%20%28TVF%29&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; Supplementary-Aware String Manipulation &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2005%21Supplementary-Aware%20String%20Manipulation&amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21Supplementary-Aware%20String%20Manipulation&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; System.Transactions Sample &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2005%21System.Transactions%20Sample&amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21System.Transactions%20Sample&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; Time Series Sample &lt;/td&gt;&lt;td&gt; n/a &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21Time%20Series%20Sample&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; UDT Utilities &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2005%21UDT%20Utilities&amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21UDT%20Utilities&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; User-Defined Data Type (UDT) Sample &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2005%21User-Defined%20Data%20Type%20%28UDT%29%20Sample&amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21User-Defined%20Data%20Type%20%28UDT%29%20Sample&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; UTF8 String User-Defined Data Type (UDT) &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2005%21UTF8%20String%20User-Defined%20Data%20Type%20%28UDT%29&amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21UTF8%20String%20User-Defined%20Data%20Type%20%28UDT%29&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;
&lt;h3&gt;&lt;b&gt;Full Text Search&lt;/b&gt;&lt;/h3&gt;&lt;table&gt;&lt;tr&gt;&lt;th&gt; Sample &lt;/th&gt;&lt;th&gt; SQL Server 2005 &lt;/th&gt;&lt;th&gt; SQL Server 2008 &amp;amp; SQL Server 2008R2 &lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; Item Finder Sample &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2005%21Item%20Finder%20Sample&amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21Item%20Finder%20Sample&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;
&lt;h3&gt;&lt;b&gt;SMO&lt;/b&gt;&lt;/h3&gt;&lt;table&gt;&lt;tr&gt;&lt;th&gt; Sample &lt;/th&gt;&lt;th&gt; SQL Server 2005 &lt;/th&gt;&lt;th&gt; SQL Server 2008 &amp;amp; SQL Server 2008R2 &lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; BackRest &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2005%21Readme_BackRest&amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21Readme_BackRest&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; CheckIdentityValues &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2005%21ReadMe_CheckIdentityValues&amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21ReadMe_CheckIdentityValues&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; CreateSPs &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2005%21Readme_CreateSPs&amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21Readme_CreateSPs&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; DatabaseDefrag &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2005%21ReadMe_DatabaseDefrag&amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21ReadMe_DatabaseDefrag&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; DatabaseSpace &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2005%21ReadMe_DatabaseSpace&amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21ReadMe_DatabaseSpace&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; DependencyExplorer &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2005%21Readme_DependencyExplorer&amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21Readme_DependencyExplorer&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; IndexSizes &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2005%21ReadMe_IndexSizes&amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21ReadMe_IndexSizes&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; LoadRegAssembly &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2005%21Readme_LoadRegAssembly&amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21Readme_LoadRegAssembly&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; ManageDatabases &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2005%21Readme_ManageDatabases&amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21Readme_ManageDatabases&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; ManageDatabaseUsers &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2005%21Readme_ManageDatabaseUsers&amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21Readme_ManageDatabaseUsers&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; ManageTables &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2005%21Readme_ManageTables&amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21Readme_ManageTables&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; RebuildAllIndexes &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2005%21ReadMe_RebuildAllIndexes&amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21ReadMe_RebuildAllIndexes&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; ScriptTable &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2005%21Readme_ScriptTable&amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21Readme_ScriptTable&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; ServerConnect &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2005%21Readme_ServerConnect&amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21Readme_ServerConnect&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; ServerInfo &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2005%21Readme_ServerInfo&amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21Readme_ServerInfo&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; ServiceBrokerConfiguration &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2005%21Readme_ServiceBrokerConfiguration&amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21Readme_ServiceBrokerConfiguration&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; SmoBrowser &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2005%21Readme_SmoBrowser&amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21Readme_SmoBrowser&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; SmoCompare &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2005%21Readme_SmoCompare&amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21Readme_SmoCompare&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; SmoEvents &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2005%21ReadMe_SmoEvents&amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21ReadMe_SmoEvents&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; SMOPing &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2005%21Readme_SMOPing&amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21Readme_SMOPing&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; SmoScripter &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2005%21Readme_SmoScripter&amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21Readme_SmoScripter&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; SqlServerList &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2005%21Readme_SqlServerList&amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21Readme_SqlServerList&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; SqlService &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2005%21Readme_SqlService&amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21Readme_SqlService&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; Tracer &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2005%21Readme_Tracer&amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21Readme_Tracer&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; UtilityConversion &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2005%21Readme_UtilityConversion&amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21Readme_UtilityConversion&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; VerifyBackup &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2005%21Readme_VerifyBackup&amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://msftengprodsamples.codeplex.com/wikipage?title=SS2008%21Readme_VerifyBackup&amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Got questions? Want to contribute?&lt;/b&gt; Check out the &lt;a href="http://social.msdn.microsoft.com/Forums/en-us/sqlserversamples/threads" class="externalLink"&gt;SQL Server Community &amp;amp; Samples Discussion Forum&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;!&lt;br /&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>bonniefe</author><pubDate>Tue, 08 Dec 2009 23:52:36 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Home 20091208115236P</guid></item><item><title>Updated Wiki: SS2005!Currency Web Service Sample</title><link>http://msftengprodsamples.codeplex.com/Wiki/View.aspx?title=SS2005!Currency Web Service Sample&amp;version=17</link><description>&lt;div class="wikidoc"&gt;&lt;h2&gt;Currency Web Service Sample&lt;/h2&gt;
  &lt;br /&gt;&lt;br /&gt;The Currency Web Service sample for SQL Server 2005 demonstrates how to invoke a Web service from server-side common language runtime code. Suppose that there is a Web server available somewhere which can supply current currency exchange information. This sample demonstrates how to expose the result of calling that Web service as a common language runtime-based table valued function (TVF). This table valued function could be used, for example, to periodically insert new rows into the &lt;b&gt;Sales.CurrencyRate&lt;/b&gt; rate table in the AdventureWorks database. A simple implementation of the Web service is provided to demonstrate the complete scenario, but the data used in the sample is fictitious. &lt;br /&gt;The default installation directory is &lt;i&gt;drive&lt;/i&gt;:\Program&amp;#160;Files\Microsoft&amp;#160;SQL&amp;#160;Server\90\Samples\Engine\Programmability\CLR\CurrencyWebService.&lt;br /&gt;
&lt;h3&gt;Scenario&lt;/h3&gt;A developer wants invoke a Web service from server-side common language runtime code and use the results returned by invoking the Web service.&lt;br /&gt;
&lt;h3&gt;Languages&lt;/h3&gt; Transact-SQL and Visual C#.&lt;br /&gt;
&lt;h3&gt;Features&lt;/h3&gt;The Currency Web Service sample uses the following features of SQL Server:&lt;br /&gt;  &lt;br /&gt;&lt;table&gt;&lt;tr&gt;&lt;th&gt;  Application Area &lt;/th&gt;&lt;th&gt;  Features  &lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; Overall&lt;/td&gt;&lt;td&gt; Invoking Web services; common language runtime table valued functions; SOAP &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;
&lt;h3&gt;Prerequisites&lt;/h3&gt;Before running this sample, make sure the following software is installed:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt; SQL Server 2005 or SQL Server 2005 Express Edition (SQL Server Express). You can obtain SQL Server Express free of charge from the SQL Server 2005 Express Edition Documentation and Samples &lt;a href="http://go.microsoft.com/fwlink/?LinkId=31046" class="externalLink"&gt;Web site&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;  &lt;/li&gt;
&lt;li&gt; The AdventureWorks database which is included with SQL Server 2005, and is also available at the SQL Server Developer &lt;a href="http://go.microsoft.com/fwlink/?linkid=62796" class="externalLink"&gt;Web site&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.  &lt;/li&gt;
&lt;li&gt; The SQL Server 2005 Database Engine samples. These samples are included with SQL Server 2005. You can download the latest version of the samples at the SQL Server Developer &lt;a href="http://go.microsoft.com/fwlink/?linkid=62796" class="externalLink"&gt;Web site&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.  &lt;/li&gt;
&lt;li&gt; .NET Framework SDK 2.0 or Microsoft Visual Studio 2005. You can obtain .NET Framework SDK free of charge. See &lt;b&gt;Installing the .NET Framework SDK&lt;/b&gt;.  &lt;/li&gt;&lt;/ul&gt;
&lt;h3&gt;Building the Sample&lt;/h3&gt;If you have not already created the strong-name key file &lt;b&gt;ExternalSampleKey.snk&lt;/b&gt;, generate the key file by using the following instructions. &lt;br /&gt;
&lt;h6&gt;To generate a strong name key file&lt;/h6&gt;
&lt;ol&gt;&lt;li&gt;Open a Microsoft Visual Studio 2005 command prompt. Click &lt;b&gt;Start&lt;/b&gt;, point to &lt;b&gt;All Programs&lt;/b&gt;, point to &lt;b&gt;Microsoft Visual Studio 2005&lt;/b&gt;, point to &lt;b&gt;Visual Studio Tools&lt;/b&gt;, and then click &lt;b&gt;Visual Studio 2005 Command Prompt&lt;/b&gt;.—Or—Open a Microsoft .NET Framework command prompt. Click &lt;b&gt;Start&lt;/b&gt;, point to &lt;b&gt;All Programs&lt;/b&gt;, point to &lt;b&gt;Microsoft .NET Framework SDK 2.0&lt;/b&gt;, and then click &lt;b&gt;SDK Command Prompt&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;At the command prompt, use the change directory (CD) command to change the current folder of the command prompt window to the Samples folder.  &lt;b&gt;Note:   To determine the folder where samples are located, click &lt;/b&gt;Start&lt;b&gt;, point to &lt;/b&gt;All Programs&lt;b&gt;, point to &lt;/b&gt;Microsoft SQL Server 2005&lt;b&gt;, point to &lt;/b&gt;Documentation and Tutorials&lt;b&gt;, and then click &lt;/b&gt;Samples Directory&lt;b&gt;. If the default installation location was used, the samples are located in &amp;lt;&lt;i&gt;system&lt;/i&gt;drive_&amp;gt;:\Program Files\Microsoft SQL Server\90\Samples.&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;At the command prompt, run the following command to generate the key file: &lt;span class="codeInline"&gt;sn -k ExternalSampleKey.snk&lt;/span&gt; ** &lt;b&gt;Important:   For more information about the strong-name key pair, see &amp;quot;Security Briefs: Strong Names and Security in the .NET Framework&amp;quot; in the .NET Development Center on MSDN.&lt;/b&gt;To build the sample, do the following:&lt;/li&gt;&lt;/ol&gt;

&lt;h6&gt;Build the sample&lt;/h6&gt;
&lt;ol&gt;&lt;li&gt;If you haven't already done so using Windows Explorer click right on the CS\CurrencyWebService directory and enable web sharing for that directory.&lt;/li&gt;
&lt;li&gt;If you want to see how the client web service proxy in CS\CurrencyWebClient\service.cs file was created using the WSDL.exe tool, look at the scripts\RebuildWebReference.cmd file.&lt;/li&gt;
&lt;li&gt;Compile the sample by using Visual Studio 2005 and the provided Visual Studio solution, or by using Microsoft MSBuild, which is included in the .NET Framework SDK 2.0. Run a command similar to the following at the command prompt: &lt;span class="codeInline"&gt;msbuild /nologo /verbosity:quiet /property:Configuration=Debug CS\CurrencyWebService.sln&lt;/span&gt;  &lt;span class="codeInline"&gt;This solution compiles both the web server code and the web client code.&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;Make sure that the AdventureWorks database is installed.&lt;/li&gt;
&lt;li&gt;At the command prompt CD to the CS\CurrencyWebClient\bin\debug directory and execute the scripts\sgen.cmd batch file. This creates the CurrencyWebClient.XmlSerializers.dll library necessary to avoid dynamically generating the serializers used during the invocation of the web service. By creating this assembly and registering it with SQL Server it is possible to invoke a web service using only External Access rather than Unsafe permissions which is highly desirable.&lt;/li&gt;
&lt;li&gt;If you did not install the SQL Server Database Engine samples in the default location, modify the path in the CREATE ASSEMBLY part of the script in Scripts\InstallCS.sql and Scripts\InstallVB.sql to refer to location where the samples were installed.&lt;/li&gt;
&lt;li&gt;If you are not an administrator for the SQL Server instance you are using, you must have an administrator grant you &lt;b&gt;CreateAssembly&lt;/b&gt; permission to complete the installation.&lt;/li&gt;
&lt;li&gt;Open the scripts\installDB.sql file in SQL Server Management Studio. Run the script that is contained in the file, or run a command similar to the following at the command prompt: &lt;span class="codeInline"&gt;sqlcmd -E -I -i Scripts\InstallDB.sql&lt;/span&gt; This script creates the &lt;b&gt;AdventureWorksCurrency&lt;/b&gt; database which contains the fictitious currency conversion data used by the currency web service.&lt;/li&gt;
&lt;li&gt;Open the scripts\installCS.sql. Run the script that is contained in the file, or run a command similar to the following at the command prompt: &lt;span class="codeInline"&gt;sqlcmd -E -I -i Scripts\InstallCS.sql&lt;/span&gt; This script does the following: &lt;/li&gt;
&lt;li&gt; Removes any stored procedures and functions that are about to be defined, if they exist.  &lt;/li&gt;
&lt;li&gt; Drops the assembly registration, if it already exists.  &lt;/li&gt;
&lt;li&gt; Ensures that the strong name used to sign the assemblies has the appropriate external access permissions.  &lt;/li&gt;
&lt;li&gt; Registers the assembly with the web service client.  &lt;/li&gt;
&lt;li&gt; Registers the assembly with the static serializers needed to avoid dynamically creating the serializers during the invocation of the web service.  &lt;/li&gt;
&lt;li&gt; Registers the CLR table valued function which invokes the web service.  &lt;/li&gt;
&lt;li&gt; Creates a Transact-SQL stored procedure called by the web service.  &lt;/li&gt;&lt;/ol&gt;
&lt;h3&gt;Running the Sample&lt;/h3&gt;To run the sample, do the following:&lt;br /&gt;
&lt;h6&gt;Run the sample&lt;/h6&gt;
&lt;ol&gt;&lt;li&gt;Open the scripts\test.sql file in Management Studio and run the script that is contained in the file. Or, run the following command at the command prompt: &lt;span class="codeInline"&gt;sqlcmd -E -I -i Scripts\test.sql&lt;/span&gt; &lt;/li&gt;&lt;/ol&gt;
&lt;h3&gt;Removing the Sample&lt;/h3&gt;To remove the sample, do the following:&lt;br /&gt;
&lt;h6&gt;Remove the sample&lt;/h6&gt;
&lt;ol&gt;&lt;li&gt;Open the scripts\cleanup.sql file in Management Studio and run the script that is contained in the file. Or, run the following command at the command prompt: &lt;span class="codeInline"&gt;sqlcmd -E -I -i Scripts\cleanup.sql&lt;/span&gt; &lt;/li&gt;&lt;/ol&gt;
&lt;h3&gt;Comments&lt;/h3&gt;Normally for security reasons it is better to invoke Web services in the middle tier of an application. One reasonable reason to invoke Web services from the data tier would be to exchange data between SQL Server 2005 and an application running on some non-Microsoft server such as an IBM mainframe which might only be conveniently accessible via Web services. The security concerns can be mitigated by having both servers behind two layers of firewall. Web services that transmit sensitive information should use the https protocol instead of the http protocol.&lt;br /&gt;The common language runtime for SQL Server 2005 or SQL Server 2005 Express Edition must be enabled for this sample to work correctly.&lt;br /&gt; Samples are provided for educational purposes only. They are not intended to be used in a production environment and have not been tested in a production environment. Microsoft does not provide technical support for these samples. Sample applications and assemblies should not be connected to or used with your production SQL Server database or your report server without the permission of the system administrator. &lt;br /&gt; &amp;#169; 2007 Microsoft Corporation. All rights reserved.&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>bonniefe</author><pubDate>Mon, 24 Aug 2009 21:55:41 GMT</pubDate><guid isPermaLink="false">Updated Wiki: SS2005!Currency Web Service Sample 20090824095541P</guid></item><item><title>Updated Wiki: SS2008!Currency Web Service Sample</title><link>http://msftengprodsamples.codeplex.com/Wiki/View.aspx?title=SS2008!Currency Web Service Sample&amp;version=10</link><description>&lt;div class="wikidoc"&gt;&lt;h2&gt;Readme_Currency Web Service Sample&lt;/h2&gt;
 8/24/2000 &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt; This sample works only with SQL Server 2005 and SQL Server 2008. It will not work with any version of SQL Server earlier than SQL Server 2005. &lt;br /&gt;The Currency Web Service sample for SQL Server demonstrates how to invoke a Web service from server-side common language runtime code. Suppose that there is a Web server available somewhere which can supply current currency exchange information. This sample demonstrates how to expose the result of calling that Web service as a common language runtime-based table valued function (TVF). This table valued function could be used, for example, to periodically insert new rows into the &lt;b&gt;Sales.CurrencyRate&lt;/b&gt; rate table in the AdventureWorks database. A simple implementation of the Web service is provided to demonstrate the complete scenario, but the data used in the sample is fictitious.&lt;br /&gt;&lt;br /&gt;&lt;table&gt;&lt;tr&gt;&lt;th&gt; Note:  &lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;  When you compile samples that use SQL Server's CLR integration, the path of the version of the Microsoft .NET Framework compiler that was distributed with SQL Server must be the first Framework directory in the PATH environment variable. The location of the compiler that is included with SQL Server will be either &lt;i&gt;drive&lt;/i&gt;:\WINNT\Microsoft.NET\Framework\v2.0.&lt;i&gt;xxxxx&lt;/i&gt; or &lt;i&gt;drive&lt;/i&gt;:\Windows\Microsoft.NET\Framework\v2.0.&lt;i&gt;xxxxx&lt;/i&gt;, where &lt;i&gt;drive&lt;/i&gt; is the installation drive and &lt;i&gt;xxxxx&lt;/i&gt; is the version number of the .NET Framework that was included with SQL Server. &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The default installation directory is C:\Program Files\Microsoft SQL Server\100\Samples\Engine\Programmability\CLR\CurrencyWebService.&lt;br /&gt; SQL Server samples and sample databases must be downloaded and installed before you can view or work with them. For more information, see &lt;i&gt;Considerations for Installing SQL Server Samples and Sample Databases&lt;/i&gt;.&lt;br /&gt;
&lt;h3&gt;Scenario&lt;/h3&gt;A developer wants to invoke a Web service from server-side common language runtime code and use the results returned by invoking the Web service.&lt;br /&gt;
&lt;h3&gt;Languages&lt;/h3&gt; Transact-SQL and Visual C#.&lt;br /&gt;
&lt;h3&gt;Features&lt;/h3&gt;The Currency Web Service sample uses the following features of SQL Server:&lt;br /&gt;&lt;br /&gt;&lt;table&gt;&lt;tr&gt;&lt;th&gt;  Application Area &lt;/th&gt;&lt;th&gt;  Features  &lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; Overall&lt;/td&gt;&lt;td&gt; Invoking Web services; common language runtime table valued functions; SOAP &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;
&lt;h3&gt;Prerequisites&lt;/h3&gt;Before running this sample, make sure the following software is installed:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt; SQL Server.  This sample is not supported for SQL Server Express.   &lt;/li&gt;
&lt;li&gt; The AdventureWorks database that is available at the SQL Server Developer &lt;a href="http://go.microsoft.com/fwlink/?linkid=62796" class="externalLink"&gt;Web site&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.  &lt;/li&gt;
&lt;li&gt; The SQL Server Database Engine samples that are available at the SQL Server Developer &lt;a href="http://go.microsoft.com/fwlink/?linkid=62796" class="externalLink"&gt;Web site&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.  &lt;/li&gt;
&lt;li&gt; .NET Framework SDK 2.0 or Microsoft Visual Studio 2005. You can obtain .NET Framework SDK free of charge. See &lt;b&gt;Installing the .NET Framework Documentation&lt;/b&gt;.  &lt;/li&gt;
&lt;li&gt; Internet Information Service (IIS), include all necessary components of IIS which are necessary for ASP.NET applications.  &lt;/li&gt;&lt;/ul&gt;
&lt;h3&gt;Building the Sample&lt;/h3&gt;Before you build the sample, you must create the strong-name key file ExternalSampleKey.snk, as follows:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt; Open a Microsoft Visual Studio or .NET Framework command prompt.  &lt;/li&gt;
&lt;li&gt; Change directories to C:\Program Files\Microsoft SQL Server\100\Samples.  &lt;/li&gt;
&lt;li&gt; Type the following command:   *  sn -k ExternalSampleKey.snk *To build the sample, do the following:&lt;/li&gt;&lt;/ol&gt;

&lt;h6&gt;Build the sample&lt;/h6&gt;
&lt;ol&gt;&lt;li&gt;For Windows XP and Windows 2003, if you haven't already done so using Windows Explorer click right on the CS\CurrencyWebService directory and enable web sharing for that directory.&lt;/li&gt;
&lt;li&gt;For Windows Vista if you haven't already done so set up the web application for the web service using the following steps:&lt;/li&gt;
&lt;li&gt; Click &lt;b&gt;Start&lt;/b&gt; / &lt;b&gt;Control Panel&lt;/b&gt; / &lt;b&gt;Administrative Tools&lt;/b&gt; / &lt;b&gt;Internet Information Services (IIS) Manager&lt;/b&gt;.  &lt;/li&gt;
&lt;li&gt; In the Connections tree control open up the local machine and then the &lt;b&gt;Web Sites&lt;/b&gt; folder. Click right on &lt;b&gt;Default Web Site&lt;/b&gt; and click &lt;b&gt;Add Application...&lt;/b&gt; Specify &lt;b&gt;CurrencyWebService&lt;/b&gt; for the &lt;b&gt;Alias&lt;/b&gt;, and specify the full (absolute) path to the CS\CurrencyWebService directory for the &lt;b&gt;Physical path&lt;/b&gt;. Click &lt;b&gt;OK&lt;/b&gt;.  &lt;/li&gt;
&lt;li&gt; Grant the NETWORK SERVICE account the default permissions (&lt;b&gt;Read &amp;amp; execute&lt;/b&gt;, &lt;b&gt;List folder contents&lt;/b&gt;, and &lt;b&gt;Read&lt;/b&gt;) for the CS\CurrencyWebService directory.  &lt;/li&gt;
&lt;li&gt;If you want to see how the client web service proxy in CS\CurrencyWebClient\service.cs file was created using the WSDL.exe tool, look at the scripts\RebuildWebReference.cmd file.&lt;/li&gt;
&lt;li&gt;Compile the sample by using Visual Studio 2005 and the provided Visual Studio solution, or by using Microsoft MSBuild, which is included in the .NET Framework SDK 2.0. Run a command similar to the following at the command prompt: &lt;span class="codeInline"&gt;msbuild /nologo /verbosity:quiet /property:Configuration=Debug CS\CurrencyWebService.sln&lt;/span&gt; This solution compiles both the web server code and the web client code.&lt;/li&gt;
&lt;li&gt;Make sure that the AdventureWorks database is installed.&lt;/li&gt;
&lt;li&gt;At the command prompt change to the CS\CurrencyWebClient\bin\debug directory and execute the scripts\sgen.cmd batch file. This creates the CurrencyWebClient.XmlSerializers.dll library necessary to avoid dynamically generating the serializers used during the invocation of the web service. By creating this assembly and registering it with SQL Server it is possible to invoke a web service using only External Access rather than Unsafe permissions which is highly desirable.&lt;/li&gt;
&lt;li&gt;If you did not install the SQL Server Database Engine samples in the default location, modify the path in the CREATE ASSEMBLY part of the script in Scripts\InstallCS.sql to refer to location where the samples were installed.  Also do this for Scripts\InstallDB.sql.&lt;/li&gt;
&lt;li&gt;If you are not an administrator for the SQL Server instance you are using, you must have an administrator grant you &lt;b&gt;CreateAssembly&lt;/b&gt; permission to complete the installation.&lt;/li&gt;
&lt;li&gt;Open the scripts\installDB.sql file in SQL Server Management Studio. Run the script that is contained in the file, or run a command similar to the following at the command prompt: &lt;span class="codeInline"&gt;sqlcmd -E -I -i Scripts\InstallDB.sql&lt;/span&gt; This script creates the &lt;b&gt;AdventureWorksCurrency&lt;/b&gt; database which contains the fictitious currency conversion data used by the currency web service.&lt;/li&gt;
&lt;li&gt;Open the scripts\installCS.sql. Run the script that is contained in the file, or run a command similar to the following at the command prompt: &lt;span class="codeInline"&gt;sqlcmd -E -I -i Scripts\InstallCS.sql&lt;/span&gt; This script does the following: &lt;/li&gt;
&lt;li&gt; Removes any stored procedures and functions that are about to be defined, if they exist.  &lt;/li&gt;
&lt;li&gt; Drops the assembly registration, if it already exists.  &lt;/li&gt;
&lt;li&gt; Ensures that the strong name used to sign the assemblies has the appropriate external access permissions.  &lt;/li&gt;
&lt;li&gt; Registers the assembly with the web service client.  &lt;/li&gt;
&lt;li&gt; Registers the assembly with the static serializers needed to avoid dynamically creating the serializers during the invocation of the web service.  &lt;/li&gt;
&lt;li&gt; Registers the CLR table valued function which invokes the web service.  &lt;/li&gt;
&lt;li&gt; Creates a Transact-SQL stored procedure called by the web service.  &lt;/li&gt;&lt;/ol&gt;
&lt;h3&gt;Running the Sample&lt;/h3&gt;To run the sample, do the following:&lt;br /&gt;
&lt;h6&gt;Run the sample&lt;/h6&gt;
&lt;ol&gt;&lt;li&gt;Open the scripts\test.sql file in Management Studio and run the script that is contained in the file. Or, run the following command at the command prompt: &lt;span class="codeInline"&gt;sqlcmd -E -I -i Scripts\test.sql&lt;/span&gt; &lt;/li&gt;&lt;/ol&gt;
&lt;h3&gt;Removing the Sample&lt;/h3&gt;To remove the sample, do the following:&lt;br /&gt;
&lt;h6&gt;Remove the sample&lt;/h6&gt;
&lt;ol&gt;&lt;li&gt;Open the scripts\cleanup.sql file in Management Studio and run the script that is contained in the file. Or, run the following command at the command prompt: &lt;span class="codeInline"&gt;sqlcmd -E -I -i Scripts\cleanup.sql&lt;/span&gt; &lt;/li&gt;&lt;/ol&gt;
&lt;h3&gt;Comments&lt;/h3&gt;Normally for security reasons it is better to invoke Web services in the middle tier of an application. One reasonable reason to invoke Web services from the data tier would be to exchange data between SQL Server and an application running on some non-Microsoft server such as an IBM mainframe which might only be conveniently accessible via Web services. The security concerns can be mitigated by having both servers behind two layers of firewall. Web services that transmit sensitive information should use the https protocol instead of the http protocol.&lt;br /&gt;The common language runtime for SQL Server must be enabled for this sample to work correctly.&lt;br /&gt; Samples are provided for educational purposes only. They are not intended to be used in a production environment and have not been tested in a production environment. Microsoft does not provide technical support for these samples. Sample applications and assemblies should not be connected to or used with your production SQL Server database or your report server without the permission of the system administrator. &lt;br /&gt;
&lt;h3&gt;See Also&lt;/h3&gt;
&lt;h6&gt;Concepts&lt;/h6&gt;&lt;i&gt;CLR Programmability Samples&lt;/i&gt;  
&lt;h6&gt;Other Resources&lt;/h6&gt;&lt;b&gt;Common Language Runtime (CLR) Integration Programming Concepts&lt;/b&gt;    
&lt;h6&gt; Help and Information&lt;/h6&gt;&lt;ul&gt;&lt;li&gt;Getting SQL Server 2008 Assistance* &amp;#169; 2008 Microsoft Corporation. All rights reserved.&lt;/li&gt;&lt;/ul&gt;
		&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>bonniefe</author><pubDate>Mon, 24 Aug 2009 21:54:34 GMT</pubDate><guid isPermaLink="false">Updated Wiki: SS2008!Currency Web Service Sample 20090824095434P</guid></item><item><title>Updated Wiki: SS2008!Data Warehouse Tuning Techniques Sample</title><link>http://msftengprodsamples.codeplex.com/Wiki/View.aspx?title=SS2008!Data Warehouse Tuning Techniques Sample&amp;version=4</link><description>&lt;div class="wikidoc"&gt;&lt;h2&gt;Readme_Data Warehouse Tuning Techniques Sample&lt;/h2&gt;
 11/05/2008 21:36:06&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt; This sample works only with SQL Server 2005 and SQL Server 2008. It will not work with any version of SQL Server earlier than SQL Server 2005. &lt;br /&gt;This sample demonstrates techniques for tuning data warehouse queries to improve query performance. In most cases, the query optimizer creates high-quality query plans. However, for specific query patterns, you can improve the query plan by manually tuning the query. Here, we present three such scenarios and their tuning techniques.&lt;br /&gt;The run times cited below were recorded by using an AMD Athlon 64 X2 Dual-Core 4200 CPU with 4 GB of RAM, running Windows Server 2008 and SQL Server 2008. The queries were run from SQL Server Management Studio.&lt;br /&gt;
&lt;h3&gt;Languages&lt;/h3&gt; Transact-SQL &lt;br /&gt;
&lt;h3&gt;Prerequisites&lt;/h3&gt;Before you run this sample, install the following software.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt; SQL Server 2008 and the following components:  &lt;/li&gt;
&lt;li&gt; The Database Engine  &lt;/li&gt;
&lt;li&gt; SQL Server Management Studio   &lt;/li&gt;
&lt;li&gt; Database Engine samples for SQL Server 2008. The default installation directory is C:\Program Files\Microsoft SQL Server\100\Samples\Engine\Query Processing\Data Warehouse Tuning Techniques.  &lt;/li&gt;
&lt;li&gt; AdventureWorksDW2008  sample database for SQL Server 2008. For example, if you are using the x64 architecture, you can download SQL2008.AdventureWorks&lt;i&gt;All&lt;/i&gt;Databases.x64.msi to install  AdventureWorksDW2008 . For more information about installing the samples, see &lt;a href="http://go.microsoft.com/fwlink/?LinkId=122649" class="externalLink"&gt;Considerations for Installing SQL Server Samples and Sample Databases&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; in SQL Server 2008 Books Online.  &lt;/li&gt;&lt;/ul&gt;
&lt;h3&gt;Running the Sample&lt;/h3&gt;
&lt;h5&gt;Prepare the Database&lt;/h5&gt;The examples included with the Data Warehouse Tuning sample are designed to operate on a modified version of  AdventureWorksDW2008 . The original sample database has small fact tables in comparison to data warehousing sizes. Execute the following step one time to create the new  FactInternetSalesBig  fact table. This is approximately 1000 times larger than  FactInternetSales . &lt;br /&gt;
&lt;ul&gt;&lt;li&gt; Run Prepare.sql. Note that, depending on your machine performance, this might take around one hour or more (run time on test machine was 54 minutes). Note that the extended database will need around 25 GB of drive space.  &lt;/li&gt;&lt;/ul&gt;
&lt;h5&gt;Example 1: Tune Join Into Semi-Join&lt;/h5&gt;This example tunes a query by converting the original join into an explicit semi-join using an EXISTS subquery. Note that the DatesRange common expression returns a single row and uses the fact table only to check whether sales exist for specific dates. A join is not needed to achieve the correct query results; a semi-join is sufficient. However, the query optimizer does not replace this join with a semi-join because the replacement does not apply in all scenarios. Some aggregates (for example, SUM) allow the replacement and some aggregates (for example, COUNT) do not.&lt;br /&gt;Using EXISTS will avoid the expensive inner join, so that for each date row, only the existence of a single fact row will be checked. To demonstrate this, follow these steps:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt; Open SemiJoin.sql in SQL Server Management Studio.  &lt;/li&gt;
&lt;li&gt; Execute Original Query. Notice the time it takes to execute the query. On the test machine, the query took 2 minutes, 8 seconds.  &lt;/li&gt;
&lt;li&gt; Execute Tuned Query. Notice the time it takes to execute the query. The execution time should be significantly less than that of the original query. On the test machine, the query took 1 minute, 1 second.  &lt;/li&gt;&lt;/ol&gt;
&lt;h5&gt;Example 2: Split Distinct Aggregates&lt;/h5&gt;The Original Query of this sample generates a query plan with a multi-consumer spool, shared by the aggregate function and by the distinct operator. A spool is expensive and can be avoided by breaking up the query into a plan with two SELECT statements. This results in serial GROUP BY operators and avoids the spool and join. To demonstrate this, follow these steps:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt; Open CountDistinct.sql in SQL Server Management Studio.  &lt;/li&gt;
&lt;li&gt; Execute Original Query. Notice the time it takes to execute the query. On the test machine, the query took 3 minutes, 5 seconds.  &lt;/li&gt;
&lt;li&gt; Execute Tuned Query. Notice the time it takes to execute the query. The execution time should be significantly less than that of the original query. On the test machine, the query took 1 minute, 18 seconds.  &lt;/li&gt;&lt;/ol&gt;
&lt;h5&gt;Example 3: Reuse Common Expressions&lt;/h5&gt;The original query of this sample generates a query plan with equivalent sub-branches due to the reuse of common expressions. To avoid such duplicate plan branches, a temporary table can be used to store the intermediate result of the common expression. To demonstrate this, follow these steps:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt; Open CommonExpression.sql in SQL Server Management Studio.  &lt;/li&gt;
&lt;li&gt; Execute Original Query. Notice the time it takes to execute the query. On the test machine, the query took 2 minutes, 10 seconds.  &lt;/li&gt;
&lt;li&gt; Execute Tuned Query. Notice the time it takes to execute the query. The execution time should be significantly less than the original query. On the test machine, the query took 1 minute, 18 seconds.   &amp;#169; 2008 Microsoft Corporation. All rights reserved.&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>libinzhao</author><pubDate>Thu, 13 Aug 2009 09:25:34 GMT</pubDate><guid isPermaLink="false">Updated Wiki: SS2008!Data Warehouse Tuning Techniques Sample 20090813092534A</guid></item><item><title>Updated Wiki: SS2008!Readme_ServiceBrokerConfiguration</title><link>http://msftengprodsamples.codeplex.com/Wiki/View.aspx?title=SS2008!Readme_ServiceBrokerConfiguration&amp;version=13</link><description>&lt;div class="wikidoc"&gt;&lt;h2&gt;Readme_ServiceBrokerConfiguration Sample&lt;/h2&gt;
 11/05/2008 21:36:06&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt; This sample works only with SQL Server 2005 and SQL Server 2008. It will not work with any version of SQL Server earlier than SQL Server 2005. &lt;br /&gt;This sample shows how to create Service Broker objects by using SQL Server Management Objects (SMO). The sample is implemented because several Windows User Controls and classes necessary to create Service Broker objects. &lt;br /&gt;The sample is targeted at a Microsoft .NET Framework developer who wants to learn how to use Service Broker SMO and learn how to create Windows User Controls to manage SQL Server objects. The core scenario is a Microsoft .NET Framework developer who is creating a custom Service Broker management application. &lt;br /&gt; Samples are provided for educational purposes only. They are not intended to be used in a production environment and have not been tested in a production environment. Microsoft does not provide technical support for these samples. Sample applications and assemblies should not be connected to or used with your production SQL Server database or your report server without the permission of the system administrator. &lt;br /&gt;
&lt;h3&gt;Requirements&lt;/h3&gt;This sample requires that the following components are installed.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt; .NET Framework SDK 2.0. You can obtain .NET Framework SDK free of charge. For more information, see &lt;b&gt;Installing the .NET Framework Documentation&lt;/b&gt;.  &lt;/li&gt;
&lt;li&gt; SQL Server Database Engine.  &lt;/li&gt;&lt;/ul&gt;
&lt;h3&gt;Location&lt;/h3&gt;If the code sample was installed to the default location, the sample is located in the following directory:&lt;br /&gt; C:\Program Files\Microsoft SQL Server\100\Samples\Engine\Programmability\SMO\ServiceBrokerConfiguration&lt;br /&gt;The C# solution for the code sample is located in the CS directory.&lt;br /&gt;
&lt;h3&gt;Building the Sample&lt;/h3&gt;If you have not already created a strong name key file, generate the key file using the following instructions.&lt;br /&gt;
&lt;h6&gt; To generate a strong name key file&lt;/h6&gt;
&lt;ol&gt;&lt;li&gt;Open a Microsoft Visual Studio 2005 command prompt. Click &lt;b&gt;Start&lt;/b&gt;, point to &lt;b&gt;All Programs&lt;/b&gt;, point to &lt;b&gt;Microsoft .NET Framework SDK 2.0&lt;/b&gt;, and then click &lt;b&gt;SDK Command Prompt&lt;/b&gt;.-- or --Open a Microsoft .NET Framework command prompt. Click &lt;b&gt;Start&lt;/b&gt;, point to &lt;b&gt;All Programs&lt;/b&gt;, point to &lt;b&gt;Microsoft .NET Framework SDK 2.0&lt;/b&gt;, and then click &lt;b&gt;SDK Command Prompt&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Use the change directory command (CD) to change the current directory of the command prompt window to the folder where the samples are installed. &lt;b&gt;Note: To determine the folder where samples are located, click the &lt;/b&gt;Start* button, point to &lt;b&gt;All Programs&lt;/b&gt;, point to &lt;b&gt;Microsoft SQL Server&lt;/b&gt;, point to &lt;b&gt;Documentation and Tutorials&lt;/b&gt;, and then click &lt;b&gt;Samples Directory&lt;/b&gt;. If the default installation location was used, the samples are located in &amp;lt;system_drive&amp;gt;:\Program Files\Microsoft SQL Server\100\Samples.*&lt;/li&gt;
&lt;li&gt;At the command prompt, run the following command to generate the key file: &lt;span class="codeInline"&gt;sn -k SampleKey.snk&lt;/span&gt;  &lt;b&gt;Important: For more information about the strong-name key pair, see &amp;quot;Security Briefs: Strong Names and Security in the .NET Framework&amp;quot; in the .NET Development Center on MSDN.&lt;/b&gt;&lt;/li&gt;&lt;/ol&gt;
If you are using the Microsoft .NET Framework SDK, do the following:&lt;br /&gt;
&lt;h6&gt;Build the Visual Studio Solution&lt;/h6&gt;
&lt;ol&gt;&lt;li&gt;Click &lt;b&gt;Start&lt;/b&gt;, point to &lt;b&gt;All Programs&lt;/b&gt;, point to &lt;b&gt;Microsoft .NET Framework SDK v2.0&lt;/b&gt;, and then click &lt;b&gt;SDK Command Prompt&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Locate the root folder of the sample. Type the following command for the default location: &lt;/li&gt;&lt;/ol&gt;
&lt;pre&gt;
cd ..\Samples\Engine\Programmability\SMO\ServiceBrokerConfiguration\CS\

msbuild ConfigurationComponent.sln&lt;/pre&gt;
&lt;ol&gt;&lt;li&gt;Or, if you are using Visual Studio 2005, do the following:&lt;/li&gt;&lt;/ol&gt;
&lt;ul&gt;&lt;li&gt; Open the \CS\ConfigurationComponent.sln solution file.   &lt;/li&gt;
&lt;li&gt; Press F6 to build the solution.  &lt;/li&gt;&lt;/ul&gt;

&lt;h6&gt;Set up SQL Server sample database and sample XML schemas&lt;/h6&gt;
&lt;ol&gt;&lt;li&gt;Locate the \CS\Script folder.&lt;/li&gt;
&lt;li&gt;Open and run setup.sql from within SQL Server Management Studio.If you are setting up Remote Service Binding:&lt;/li&gt;&lt;/ol&gt;

&lt;h6&gt;Set up SQL Server master keys (optional)&lt;/h6&gt;
&lt;ol&gt;&lt;li&gt;Locate the \CS\Script folder.&lt;/li&gt;
&lt;li&gt;Open masterkey.sql from within SQL Server Management Studio.&lt;/li&gt;
&lt;li&gt;Enter a password for the master database key in the CREATE MASTER KEY ENCRYPTION BY PASSWORD = statement.&lt;/li&gt;
&lt;li&gt;Enter a password for the ssb_ConfigurationSample database key in the CREATE MASTER KEY ENCRYPTION BY PASSWORD = statement.&lt;/li&gt;
&lt;li&gt;Run masterkey.sql.&lt;/li&gt;&lt;/ol&gt;
&lt;h3&gt;Running the Sample&lt;/h3&gt;
&lt;h6&gt;To run the sample&lt;/h6&gt;
&lt;ol&gt;&lt;li&gt;The default location for the C# version is C:\Program Files\Microsoft SQL Server\100\Samples\SMO\ServiceBrokerConfiguration\CS\SampleApplication\bin\Debug\SampleApplication.exe.&lt;/li&gt;&lt;/ol&gt;
&lt;h6&gt;To connect to a local SQL Server instance&lt;/h6&gt;
&lt;ol&gt;&lt;li&gt;Enter a server name in the Server Name field, or accept the default (local) server name.&lt;/li&gt;
&lt;li&gt;Click &lt;b&gt;Connect&lt;/b&gt;.&lt;/li&gt;&lt;/ol&gt;
&lt;h6&gt;To configure the sample for a new database.&lt;/h6&gt;
&lt;ol&gt;&lt;li&gt;Click &lt;b&gt;Options&lt;/b&gt; on the &lt;b&gt;Objects&lt;/b&gt; tab.&lt;/li&gt;
&lt;li&gt;Enter a ScriptPath, or accept the default path. The ScriptPath is used to export a script to a file.&lt;/li&gt;
&lt;li&gt;Click &lt;b&gt;Create&lt;/b&gt;. The &lt;b&gt;Create&lt;/b&gt; button configures the sample, including setting the BaseUrn.&lt;/li&gt;&lt;/ol&gt;
&lt;h6&gt;To create MessageTypes&lt;/h6&gt;
&lt;ol&gt;&lt;li&gt;Click &lt;b&gt;New&lt;/b&gt;, and then click &lt;b&gt;MessageType&lt;/b&gt;.**&lt;/li&gt;
&lt;li&gt;Enter &lt;b&gt;ShippingRequest&lt;/b&gt; for the MessageType name.&lt;/li&gt;
&lt;li&gt;Click &lt;b&gt;Create&lt;/b&gt; to create the new MessageType, click &lt;b&gt;New&lt;/b&gt;, and then click &lt;b&gt;Message Type&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Enter &lt;b&gt;ShippingAccept&lt;/b&gt; for the MessageType name.&lt;/li&gt;
&lt;li&gt;Click &lt;b&gt;Create&lt;/b&gt; to create the new MessageType, click &lt;b&gt;New&lt;/b&gt;, and then click &lt;b&gt;Message Type&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Enter &lt;b&gt;ShippingComplete&lt;/b&gt; for MessageType name.&lt;/li&gt;
&lt;li&gt;Click &lt;b&gt;Create&lt;/b&gt; to create the new MessageType.&lt;/li&gt;&lt;/ol&gt;
&lt;h6&gt;To create a contract&lt;/h6&gt;
&lt;ol&gt;&lt;li&gt;Click &lt;b&gt;New&lt;/b&gt;, and then click &lt;b&gt;Contract&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Select the &lt;b&gt;MessageTypeMappings&lt;/b&gt; drop-down menu.&lt;/li&gt;
&lt;li&gt;Select all MessageTypes created above.&lt;/li&gt;
&lt;li&gt;Select &lt;b&gt;Target&lt;/b&gt; for ShippingAccept and ShippingComplete MessageSource.&lt;/li&gt;
&lt;li&gt;Close the &lt;b&gt;MessageTypeMappings&lt;/b&gt; drop-down menu.&lt;/li&gt;
&lt;li&gt;Enter &lt;b&gt;Shipping&lt;/b&gt; for the contract name.&lt;/li&gt;
&lt;li&gt;Click &lt;b&gt;Create&lt;/b&gt; to create a new contact.&lt;/li&gt;&lt;/ol&gt;
&lt;h6&gt;To create queues&lt;/h6&gt;
&lt;ol&gt;&lt;li&gt;Click &lt;b&gt;New&lt;/b&gt;, and then click &lt;b&gt;Queue&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Enter &lt;b&gt;ClientQueue&lt;/b&gt; for the queue name.&lt;/li&gt;
&lt;li&gt;Click &lt;b&gt;Create&lt;/b&gt; to create the new queue, click &lt;b&gt;New&lt;/b&gt;, and then click &lt;b&gt;Queue&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Enter &lt;b&gt;ServerQueue&lt;/b&gt; for queue name.&lt;/li&gt;
&lt;li&gt;Click &lt;b&gt;Create&lt;/b&gt; to create the new queue.&lt;/li&gt;&lt;/ol&gt;
&lt;h6&gt;To create services without RemoteServiceBinding enabled&lt;/h6&gt;
&lt;ol&gt;&lt;li&gt;Click &lt;b&gt;New&lt;/b&gt;, and then click &lt;b&gt;Service&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Enter &lt;b&gt;ClientService&lt;/b&gt; for the service name.&lt;/li&gt;
&lt;li&gt;Select the &lt;b&gt;ContractNames&lt;/b&gt; drop-down menu and select the Shipping contract.&lt;/li&gt;
&lt;li&gt;Select the &lt;b&gt;QueueName&lt;/b&gt; drop-down menu and select the ClientQueue queue.&lt;/li&gt;
&lt;li&gt;Enter or select a &lt;b&gt;ServiceOwnerName&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;b&gt;Create&lt;/b&gt; to create the new service, and then click &lt;b&gt;New&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Enter &lt;b&gt;ServerService&lt;/b&gt; for the service name.&lt;/li&gt;
&lt;li&gt;Select the &lt;b&gt;ContractNames&lt;/b&gt; drop-down and select the Shipping contract.&lt;/li&gt;
&lt;li&gt;Select the &lt;b&gt;QueueName&lt;/b&gt; drop-down menu and select the ServerQueue queue.&lt;/li&gt;
&lt;li&gt;Enter or select a &lt;b&gt;ServiceOwnerName&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;b&gt;Create&lt;/b&gt; to create the new service.&lt;/li&gt;&lt;/ol&gt;
&lt;h6&gt;To create services with RemoteServiceBinding enabled&lt;/h6&gt;
&lt;ol&gt;&lt;li&gt;Click &lt;b&gt;New&lt;/b&gt;, and then click &lt;b&gt;Service&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Enter &lt;b&gt;RemoteService&lt;/b&gt; for the service name.&lt;/li&gt;
&lt;li&gt;Select the &lt;b&gt;ContractNames&lt;/b&gt; drop-down menu and select the Shipping contract.&lt;/li&gt;
&lt;li&gt;Set EnableRemoteService to true.&lt;/li&gt;
&lt;li&gt;Select the &lt;b&gt;QueueName&lt;/b&gt; drop-down menu and select the ClientQueue queue.&lt;/li&gt;
&lt;li&gt;Enter or select a &lt;b&gt;ServiceOwnerName&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;b&gt;Create&lt;/b&gt; to create the new service.&lt;/li&gt;&lt;/ol&gt;
&lt;h6&gt;To enable anonymous access for a Remote Service&lt;/h6&gt;
&lt;ol&gt;&lt;li&gt;Select &lt;b&gt;RemoteService within the object tree&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Set AllowAnonymous to True.&lt;/li&gt;
&lt;li&gt;Click &lt;b&gt;Alter&lt;/b&gt; to alter the service.&lt;/li&gt;&lt;/ol&gt;
&lt;h6&gt;To create a Target Instance Endpoint&lt;/h6&gt;
&lt;ol&gt;&lt;li&gt;Click &lt;b&gt;New&lt;/b&gt;, and then click &lt;b&gt;Target Instance Endpoint&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Enter a name, or accept the default name.&lt;/li&gt;
&lt;li&gt;Click &lt;b&gt;Create&lt;/b&gt;.&lt;/li&gt;&lt;/ol&gt;
&lt;h6&gt;To set a script export path&lt;/h6&gt;
&lt;ol&gt;&lt;li&gt;Click the &lt;b&gt;Object&lt;/b&gt; tab if this tab is not already active.&lt;/li&gt;
&lt;li&gt;Click &lt;b&gt;Options&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Enter a valid ScriptPath.&lt;/li&gt;
&lt;li&gt;Click &lt;b&gt;Create&lt;/b&gt;.&lt;/li&gt;&lt;/ol&gt;
&lt;h6&gt;To export an object&lt;/h6&gt;
&lt;ol&gt;&lt;li&gt;Select an object within the objects tree.&lt;/li&gt;
&lt;li&gt;Click &lt;b&gt;Script&lt;/b&gt; then &lt;b&gt;Export&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;The object is exported to the ScriptPath set in Application Configuration.&lt;/li&gt;&lt;/ol&gt;
&lt;h6&gt;To export a Service definition to a file&lt;/h6&gt;
&lt;ol&gt;&lt;li&gt;Select a service from within the Objects tree.&lt;/li&gt;
&lt;li&gt;Click &lt;b&gt;Script&lt;/b&gt;, and then click &lt;b&gt;Export&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;The service script is exported to the ScriptPath set in Application Configuration.&lt;/li&gt;&lt;/ol&gt;
&lt;h6&gt;To drop an object&lt;/h6&gt;
&lt;ol&gt;&lt;li&gt;Select the object in the TreeView.&lt;/li&gt;
&lt;li&gt;Click either &lt;b&gt;Drop&lt;/b&gt; or &lt;b&gt;Edit&lt;/b&gt;, &lt;b&gt;Drop {ObjectName}.&lt;/b&gt;&lt;/li&gt;&lt;/ol&gt;
&lt;h6&gt;To alter an object&lt;/h6&gt;
&lt;ol&gt;&lt;li&gt;Click the object in the Objects tree that you want to modify.&lt;/li&gt;
&lt;li&gt;Modify the properties of that object.&lt;/li&gt;
&lt;li&gt;Click &lt;b&gt;Alter&lt;/b&gt; to alter the object.&lt;/li&gt;&lt;/ol&gt;
&lt;h6&gt;To query data describing an object&lt;/h6&gt;
&lt;ol&gt;&lt;li&gt;Each object can output data describing the object to a Textbox and/or DataGrid.&lt;/li&gt;
&lt;li&gt;Select an object in the TreeView.&lt;/li&gt;
&lt;li&gt;Click Query.&lt;/li&gt;&lt;/ol&gt;
&lt;h3&gt;Removing the Sample&lt;/h3&gt;
&lt;h6&gt;To drop services&lt;/h6&gt;
&lt;ol&gt;&lt;li&gt;Click the ClientService node.&lt;/li&gt;
&lt;li&gt;Drop the object.&lt;/li&gt;
&lt;li&gt;Click the ServerService node.&lt;/li&gt;
&lt;li&gt;Drop the object.&lt;/li&gt;
&lt;li&gt;Click the RemoteService node.&lt;/li&gt;
&lt;li&gt;Drop the object.&lt;/li&gt;&lt;/ol&gt;
&lt;h6&gt;To drop queues&lt;/h6&gt;
&lt;ol&gt;&lt;li&gt;Click the ClientQueue node.&lt;/li&gt;
&lt;li&gt;Drop the object.&lt;/li&gt;
&lt;li&gt;Click the ServerQueue node.&lt;/li&gt;
&lt;li&gt;Drop the object.&lt;/li&gt;&lt;/ol&gt;
&lt;h6&gt;To drop contracts&lt;/h6&gt;
&lt;ol&gt;&lt;li&gt;Click the Shipping contract node.&lt;/li&gt;
&lt;li&gt;Drop the object.&lt;/li&gt;&lt;/ol&gt;
&lt;h6&gt;To drop MessageTypes&lt;/h6&gt;
&lt;ol&gt;&lt;li&gt;Click the ShippingRequest MessageType node.&lt;/li&gt;
&lt;li&gt;Drop the object.&lt;/li&gt;
&lt;li&gt;Click the ShippingAccept MessageType node.&lt;/li&gt;
&lt;li&gt;Drop the object.&lt;/li&gt;
&lt;li&gt;Click the ShippingComplete MessageType node.&lt;/li&gt;
&lt;li&gt;Drop the object.&lt;/li&gt;&lt;/ol&gt;
&lt;h6&gt;To drop a Target Instance Endpoint&lt;/h6&gt;
&lt;ol&gt;&lt;li&gt;Click a Target Instance Endpoint node.&lt;/li&gt;
&lt;li&gt;Drop the object. &amp;#169; 2008 Microsoft Corporation. All rights reserved.&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>libinzhao</author><pubDate>Thu, 13 Aug 2009 09:16:37 GMT</pubDate><guid isPermaLink="false">Updated Wiki: SS2008!Readme_ServiceBrokerConfiguration 20090813091637A</guid></item><item><title>Updated Wiki: SS2008!Large Binary Object (LOB) Handling</title><link>http://msftengprodsamples.codeplex.com/Wiki/View.aspx?title=SS2008!Large Binary Object (LOB) Handling&amp;version=11</link><description>&lt;div class="wikidoc"&gt;
&lt;h2&gt;
Readme_Large Object (LOB) Handling Sample
&lt;/h2&gt; &lt;br /&gt; 11/05/2008 21:36:06&lt;br /&gt;  &lt;br /&gt; &lt;br /&gt; This sample works only with SQL Server 2005 and SQL Server 2008. It will not work with any version of SQL Server earlier than SQL Server 2005. &lt;br /&gt;The HandlingLOBUsingCLR sample for SQL Server demonstrates transferring large objects (LOBs) between SQL Server and a file system that is available to the server by using common language runtime (CLR) stored procedures. This sample demonstrates how to access files in server-side code, and then invoke both dynamic queries and stored procedures from CLR-based stored procedures. It also demonstrates how to unregister and register CLR methods and assemblies by using Transact-SQL.&lt;br /&gt; &lt;br /&gt;&lt;table&gt;
&lt;tr&gt;
&lt;th&gt; Note:  &lt;/th&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;td&gt;  When you compile SQLCLR samples, the path of the version of the .NET Framework compiler that was distributed with SQL Server must be the first Framework directory in the PATH environment variable. The location of the compiler that is included with SQL Server will be either &lt;i&gt;drive&lt;/i&gt;:\WINNT\Microsoft.NET\Framework\v2.0.&lt;i&gt;xxxxx&lt;/i&gt; or &lt;i&gt;drive&lt;/i&gt;:\Windows\Microsoft.NET\Framework\v2.0.&lt;i&gt;xxxxx&lt;/i&gt;, where &lt;i&gt;drive&lt;/i&gt; is the installation drive and &lt;i&gt;xxxxx&lt;/i&gt; is the version number of the .NET Framework that was included with SQL Server. &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt; &lt;br /&gt; &lt;br /&gt;The default installation directory is C:\Program Files\Microsoft SQL Server\100\Samples\Engine\Programmability\CLR\HandlingLOBUsingCLR.&lt;br /&gt; SQL Server samples and sample databases must be downloaded and installed before you can view or work with them. For more information, see &lt;i&gt;Considerations for Installing SQL Server Samples and Sample Databases&lt;/i&gt;.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Scenario
&lt;/h3&gt;A developer wants to copy images between SQL Server and the file system on the server.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Languages
&lt;/h3&gt; Transact-SQL, Visual C#, and Visual Basic.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Features
&lt;/h3&gt;The HandlingLOBUsingCLR sample uses the following features of SQL Server:&lt;br /&gt; &lt;br /&gt;&lt;table&gt;
&lt;tr&gt;
&lt;th&gt;  Application Area &lt;/th&gt;&lt;th&gt;  Features  &lt;/th&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;td&gt; Overall&lt;/td&gt;&lt;td&gt; CLR stored procedures; calling Transact-SQL stored procedures from CLR stored procedures; the VARBINARY(MAX) data type. &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt; &lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Prerequisites
&lt;/h3&gt;Before running this sample, make sure the following software is installed:&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt; SQL Server or SQL Server Express. You can obtain SQL Server Express free of charge from the SQL Server Express Documentation and Samples &lt;a href="http://go.microsoft.com/fwlink/?LinkId=31046" class="externalLink"&gt;Web site&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;  &lt;/li&gt;&lt;li&gt; The AdventureWorks database that is available at the SQL Server Developer &lt;a href="http://go.microsoft.com/fwlink/?linkid=62796" class="externalLink"&gt;Web site&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.  &lt;/li&gt;&lt;li&gt; The SQL Server Database Engine samples that are available at the SQL Server Developer &lt;a href="http://go.microsoft.com/fwlink/?linkid=62796" class="externalLink"&gt;Web site&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.  &lt;/li&gt;&lt;li&gt; .NET Framework SDK 2.0 or Microsoft Visual Studio 2005. You can obtain .NET Framework SDK free of charge. See &lt;b&gt;Installing the .NET Framework Documentation&lt;/b&gt;.  &lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;
Building the Sample
&lt;/h3&gt;If you have not already created the strong-name key file &lt;b&gt;ExternalSampleKey.snk&lt;/b&gt;, generate the key file using the following instructions. &lt;br /&gt; &lt;br /&gt;&lt;h6&gt;
To generate a strong name key file
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Open a Visual Studio 2005 command prompt. Click &lt;b&gt;Start&lt;/b&gt;, point to &lt;b&gt;All Programs&lt;/b&gt;, point to &lt;b&gt;Microsoft Visual Studio 2005&lt;/b&gt;, point to &lt;b&gt;Visual Studio Tools&lt;/b&gt;, and then click &lt;b&gt;Visual Studio 2005 Command Prompt&lt;/b&gt;.—Or—Open a.NET Framework command prompt. Click &lt;b&gt;Start&lt;/b&gt;, point to &lt;b&gt;All Programs&lt;/b&gt;, point to &lt;b&gt;Microsoft .NET Framework SDK 2.0&lt;/b&gt;, and then click &lt;b&gt;SDK Command Prompt&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;At the command prompt, use the change directory (CD) command to change the current folder of the command prompt window to the Samples folder.  &lt;b&gt;Note:   To determine the folder where samples are located, click &lt;b&gt;Start&lt;/b&gt;, point to &lt;b&gt;All Programs&lt;/b&gt;, point to &lt;b&gt;Microsoft SQL Server&lt;/b&gt;, point to &lt;b&gt;Documentation and Tutorials&lt;/b&gt;, and then click &lt;b&gt;Samples Directory&lt;/b&gt;. If the default installation location was used, the samples are located in &amp;lt;&lt;i&gt;system&lt;/i&gt;drive_&amp;gt;:\Program Files\Microsoft SQL Server\100\Samples.&lt;/b&gt;&lt;/li&gt;&lt;li&gt;At the command prompt, run the following command to generate the key file: &lt;span class="codeInline"&gt;sn -k ExternalSampleKey.snk&lt;/span&gt; ** &lt;b&gt;Important:   For more information about the strong-name key pair, see &amp;quot;Security Briefs: Strong Names and Security in the .NET Framework&amp;quot; in the .NET Development Center on MSDN.&lt;/b&gt;To build the sample, do the following:&lt;/li&gt;
&lt;/ol&gt; &lt;br /&gt;&lt;h6&gt;
Build the sample
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Compile the sample by using Visual Studio 2005 and the provided Visual Studio solution, or by using MSBuild, which is included in the .NET Framework SDK 2.0. Run a command similar to the following at the command prompt: &lt;span class="codeInline"&gt;msbuild /nologo /verbosity:quiet /property:Configuration=Debug CS\HandlingLOBUsingCLR.sln&lt;/span&gt; &lt;/li&gt;&lt;li&gt;Make sure that the AdventureWorks database is installed.&lt;/li&gt;&lt;li&gt;If you did not install the SQL Server Database Engine samples in the default location, modify the path in the CREATE ASSEMBLY part of the script in Scripts\InstallCS.sql and Scripts\InstallVB.sql to refer to location where the samples were installed.&lt;/li&gt;&lt;li&gt;If you are not an administrator for the SQL Server instance you are using, you must have an administrator grant you &lt;b&gt;CreateAssembly&lt;/b&gt; permission to complete the installation.&lt;/li&gt;&lt;li&gt;Open the scripts\installCS.sql or scripts\installVB.sql file, depending on whether you compiled the Visual C# project or the Visual Basic project, in SQL Server Management Studio. Run the script that is contained in the file, or run a command similar to the following at the command prompt: &lt;/li&gt;
&lt;/ol&gt;&lt;pre&gt;
sqlcmd -E -I -i Scripts\InstallCS.sql
&lt;/pre&gt; This script does the following:&lt;br /&gt;&lt;ol&gt;
&lt;li&gt; Removes any stored procedures that are about to be defined, if they exist.  &lt;/li&gt;&lt;li&gt; Drops the assembly registration, if it already exists.  &lt;/li&gt;&lt;li&gt; Registers the assembly.  &lt;/li&gt;&lt;li&gt; Registers the CLR stored procedures.  &lt;/li&gt;&lt;li&gt; Creates the Transact-SQL stored procedure called by one of the CLR stored procedures.  &lt;/li&gt;
&lt;/ol&gt;&lt;h3&gt;
Running the Sample
&lt;/h3&gt;To run the sample, do the following:&lt;br /&gt; &lt;br /&gt;&lt;h6&gt;
Run the sample
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;To read an image from the database, invoke a script similar to the following: &lt;span class="codeInline"&gt;exec GetPhotoFromDB 70, 'C:\Temp\', 'test6.gif'&lt;/span&gt;  &lt;span class="codeInline"&gt;go&lt;/span&gt; Make sure the directory you specify exists.&lt;/li&gt;&lt;li&gt;To write an image into the database, invoke a script similar to the following: &lt;span class="codeInline"&gt;exec PutPhotoIntoDB 70, 'C:\Temp\', 'test1.gif'&lt;/span&gt;  &lt;span class="codeInline"&gt;go&lt;/span&gt; Any errors will be reported to the error.log file in the directory that you specify. For scripts that are similar to the ones in this procedure, see the Scripts\test.sql file.&lt;/li&gt;
&lt;/ol&gt;&lt;h3&gt;
Removing the Sample
&lt;/h3&gt;To remove the sample, do the following:&lt;br /&gt; &lt;br /&gt;&lt;h6&gt;
Remove the sample
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Open the scripts\cleanup.sql file in Management Studio and run the script that is contained in the file. Or, run the following command at the command prompt: &lt;span class="codeInline"&gt;sqlcmd -E -I -i Scripts\cleanup.sql&lt;/span&gt; &lt;/li&gt;
&lt;/ol&gt;&lt;h3&gt;
Comments
&lt;/h3&gt;The CLR for SQL Server or SQL Server Express must be enabled for this sample to work correctly.&lt;br /&gt; Samples are provided for educational purposes only. They are not intended to be used in a production environment and have not been tested in a production environment. Microsoft does not provide technical support for these samples. Sample applications and assemblies should not be connected to or used with your production SQL Server database or your report server without the permission of the system administrator. &lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
See Also
&lt;/h3&gt; &lt;br /&gt;&lt;h6&gt;
Concepts
&lt;/h6&gt;&lt;i&gt;CLR Programmability Samples&lt;/i&gt;  &lt;br /&gt;&lt;h6&gt;
Other Resources
&lt;/h6&gt;&lt;b&gt;Common Language Runtime (CLR) Integration Programming Concepts&lt;/b&gt;    &lt;br /&gt;&lt;h6&gt;
 Help and Information
&lt;/h6&gt;&lt;ul&gt;
&lt;li&gt;Getting SQL Server 2008 Assistance* &amp;#169; 2008 Microsoft Corporation. All rights reserved.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</description><author>libinzhao</author><pubDate>Thu, 02 Apr 2009 03:11:41 GMT</pubDate><guid isPermaLink="false">Updated Wiki: SS2008!Large Binary Object (LOB) Handling 20090402031141A</guid></item><item><title>Updated Wiki: SS2008!Readme_ServiceBrokerConfiguration</title><link>http://msftengprodsamples.codeplex.com/Wiki/View.aspx?title=SS2008!Readme_ServiceBrokerConfiguration&amp;version=12</link><description>&lt;div class="wikidoc"&gt;
&lt;h2&gt;
Readme_ServiceBrokerConfiguration Sample
&lt;/h2&gt; &lt;br /&gt; 11/05/2008 21:36:06&lt;br /&gt;  &lt;br /&gt; &lt;br /&gt; This sample works only with SQL Server 2005 and SQL Server 2008. It will not work with any version of SQL Server earlier than SQL Server 2005. &lt;br /&gt;This sample shows how to create Service Broker objects by using SQL Server Management Objects (SMO). The sample is implemented because several Windows User Controls and classes necessary to create Service Broker objects. &lt;br /&gt;The sample is targeted at a Microsoft .NET Framework developer who wants to learn how to use Service Broker SMO and learn how to create Windows User Controls to manage SQL Server objects. The core scenario is a Microsoft .NET Framework developer who is creating a custom Service Broker management application. &lt;br /&gt; Samples are provided for educational purposes only. They are not intended to be used in a production environment and have not been tested in a production environment. Microsoft does not provide technical support for these samples. Sample applications and assemblies should not be connected to or used with your production SQL Server database or your report server without the permission of the system administrator. &lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Requirements
&lt;/h3&gt;This sample requires that the following components are installed.&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt; .NET Framework SDK 2.0. You can obtain .NET Framework SDK free of charge. For more information, see &lt;b&gt;Installing the .NET Framework Documentation&lt;/b&gt;.  &lt;/li&gt;&lt;li&gt; SQL Server Database Engine.  &lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;
Location
&lt;/h3&gt;If the code sample was installed to the default location, the sample is located in the following directory:&lt;br /&gt; C:\Program Files\Microsoft SQL Server\100\Samples\Engine\Programmability\SMO\ServiceBrokerConfiguration&lt;br /&gt;The C# solution for the code sample is located in the CS directory.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Building the Sample
&lt;/h3&gt;If you have not already created a strong name key file, generate the key file using the following instructions.&lt;br /&gt; &lt;br /&gt;&lt;h6&gt;
 To generate a strong name key file
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Open a Microsoft Visual Studio 2005 command prompt. Click &lt;b&gt;Start&lt;/b&gt;, point to &lt;b&gt;All Programs&lt;/b&gt;, point to &lt;b&gt;Microsoft .NET Framework SDK 2.0&lt;/b&gt;, and then click &lt;b&gt;SDK Command Prompt&lt;/b&gt;.-- or --Open a Microsoft .NET Framework command prompt. Click &lt;b&gt;Start&lt;/b&gt;, point to &lt;b&gt;All Programs&lt;/b&gt;, point to &lt;b&gt;Microsoft .NET Framework SDK 2.0&lt;/b&gt;, and then click &lt;b&gt;SDK Command Prompt&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Use the change directory command (CD) to change the current directory of the command prompt window to the folder where the samples are installed. &lt;b&gt;Note: To determine the folder where samples are located, click the &lt;b&gt;Start&lt;/b&gt; button, point to &lt;b&gt;All Programs&lt;/b&gt;, point to &lt;b&gt;Microsoft SQL Server&lt;/b&gt;, point to &lt;b&gt;Documentation and Tutorials&lt;/b&gt;, and then click &lt;b&gt;Samples Directory&lt;/b&gt;. If the default installation location was used, the samples are located in &amp;lt;system_drive&amp;gt;:\Program Files\Microsoft SQL Server\100\Samples.&lt;/b&gt;&lt;/li&gt;&lt;li&gt;At the command prompt, run the following command to generate the key file: &lt;span class="codeInline"&gt;sn -k SampleKey.snk&lt;/span&gt;  &lt;b&gt;Important: For more information about the strong-name key pair, see &amp;quot;Security Briefs: Strong Names and Security in the .NET Framework&amp;quot; in the .NET Development Center on MSDN.&lt;/b&gt;&lt;/li&gt;
&lt;/ol&gt;If you are using the Microsoft .NET Framework SDK, do the following:&lt;br /&gt; &lt;br /&gt;&lt;h6&gt;
Build the Visual Studio Solution
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Click &lt;b&gt;Start&lt;/b&gt;, point to &lt;b&gt;All Programs&lt;/b&gt;, point to &lt;b&gt;Microsoft .NET Framework SDK v2.0&lt;/b&gt;, and then click &lt;b&gt;SDK Command Prompt&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Locate the root folder of the sample. Type the following command for the default location: &lt;/li&gt;
&lt;/ol&gt;&lt;pre&gt;
cd ..\Samples\Engine\Programmability\SMO\ServiceBrokerConfiguration\CS\
 
msbuild ConfigurationComponent.sln
&lt;/pre&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Or, if you are using Visual Studio 2005, do the following:&lt;/li&gt;
&lt;/ol&gt;&lt;ul&gt;
&lt;ul&gt;
&lt;li&gt; Open the \CS\ConfigurationComponent.sln solution file.   &lt;/li&gt;&lt;li&gt; Press F6 to build the solution.  &lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt; &lt;br /&gt;&lt;h6&gt;
Set up SQL Server sample database and sample XML schemas
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Locate the \CS\Script folder.&lt;/li&gt;&lt;li&gt;Open and run setup.sql from within SQL Server Management Studio.If you are setting up Remote Service Binding:&lt;/li&gt;
&lt;/ol&gt; &lt;br /&gt;&lt;h6&gt;
Set up SQL Server master keys (optional)
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Locate the \CS\Script folder.&lt;/li&gt;&lt;li&gt;Open masterkey.sql from within SQL Server Management Studio.&lt;/li&gt;&lt;li&gt;Enter a password for the master database key in the CREATE MASTER KEY ENCRYPTION BY PASSWORD = statement.&lt;/li&gt;&lt;li&gt;Enter a password for the ssb_ConfigurationSample database key in the CREATE MASTER KEY ENCRYPTION BY PASSWORD = statement.&lt;/li&gt;&lt;li&gt;Run masterkey.sql.&lt;/li&gt;
&lt;/ol&gt;&lt;h3&gt;
Running the Sample
&lt;/h3&gt; &lt;br /&gt;&lt;h6&gt;
To run the sample
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;The default location for the C# version is C:\Program Files\Microsoft SQL Server\100\Samples\SMO\ServiceBrokerConfiguration\CS\SampleApplication\bin\Debug\SampleApplication.exe.&lt;/li&gt;
&lt;/ol&gt;&lt;h6&gt;
To connect to a local SQL Server instance
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Enter a server name in the Server Name field, or accept the default (local) server name.&lt;/li&gt;&lt;li&gt;Click &lt;b&gt;Connect&lt;/b&gt;.&lt;/li&gt;
&lt;/ol&gt;&lt;h6&gt;
To configure the sample for a new database.
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Click &lt;b&gt;Options&lt;/b&gt; on the &lt;b&gt;Objects&lt;/b&gt; tab.&lt;/li&gt;&lt;li&gt;Enter a ScriptPath, or accept the default path. The ScriptPath is used to export a script to a file.&lt;/li&gt;&lt;li&gt;Click &lt;b&gt;Create&lt;/b&gt;. The &lt;b&gt;Create&lt;/b&gt; button configures the sample, including setting the BaseUrn.&lt;/li&gt;
&lt;/ol&gt;&lt;h6&gt;
To create MessageTypes
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Click &lt;b&gt;New&lt;/b&gt;, and then click &lt;b&gt;MessageType&lt;/b&gt;.**&lt;/li&gt;&lt;li&gt;Enter &lt;b&gt;ShippingRequest&lt;/b&gt; for the MessageType name.&lt;/li&gt;&lt;li&gt;Click &lt;b&gt;Create&lt;/b&gt; to create the new MessageType, click &lt;b&gt;New&lt;/b&gt;, and then click &lt;b&gt;Message Type&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Enter &lt;b&gt;ShippingAccept&lt;/b&gt; for the MessageType name.&lt;/li&gt;&lt;li&gt;Click &lt;b&gt;Create&lt;/b&gt; to create the new MessageType, click &lt;b&gt;New&lt;/b&gt;, and then click &lt;b&gt;Message Type&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Enter &lt;b&gt;ShippingComplete&lt;/b&gt; for MessageType name.&lt;/li&gt;&lt;li&gt;Click &lt;b&gt;Create&lt;/b&gt; to create the new MessageType.&lt;/li&gt;
&lt;/ol&gt;&lt;h6&gt;
To create a contract
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Click &lt;b&gt;New&lt;/b&gt;, and then click &lt;b&gt;Contract&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Select the &lt;b&gt;MessageTypeMappings&lt;/b&gt; drop-down menu.&lt;/li&gt;&lt;li&gt;Select all MessageTypes created above.&lt;/li&gt;&lt;li&gt;Select &lt;b&gt;Target&lt;/b&gt; for ShippingAccept and ShippingComplete MessageSource.&lt;/li&gt;&lt;li&gt;Close the &lt;b&gt;MessageTypeMappings&lt;/b&gt; drop-down menu.&lt;/li&gt;&lt;li&gt;Enter &lt;b&gt;Shipping&lt;/b&gt; for the contract name.&lt;/li&gt;&lt;li&gt;Click &lt;b&gt;Create&lt;/b&gt; to create a new contact.&lt;/li&gt;
&lt;/ol&gt;&lt;h6&gt;
To create queues
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Click &lt;b&gt;New&lt;/b&gt;, and then click &lt;b&gt;Queue&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Enter &lt;b&gt;ClientQueue&lt;/b&gt; for the queue name.&lt;/li&gt;&lt;li&gt;Click &lt;b&gt;Create&lt;/b&gt; to create the new queue, click &lt;b&gt;New&lt;/b&gt;, and then click &lt;b&gt;Queue&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Enter &lt;b&gt;ServerQueue&lt;/b&gt; for queue name.&lt;/li&gt;&lt;li&gt;Click &lt;b&gt;Create&lt;/b&gt; to create the new queue.&lt;/li&gt;
&lt;/ol&gt;&lt;h6&gt;
To create services without RemoteServiceBinding enabled
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Click &lt;b&gt;New&lt;/b&gt;, and then click &lt;b&gt;Service&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Enter &lt;b&gt;ClientService&lt;/b&gt; for the service name.&lt;/li&gt;&lt;li&gt;Select the &lt;b&gt;ContractNames&lt;/b&gt; drop-down menu and select the Shipping contract.&lt;/li&gt;&lt;li&gt;Select the &lt;b&gt;QueueName&lt;/b&gt; drop-down menu and select the ClientQueue queue.&lt;/li&gt;&lt;li&gt;Enter or select a &lt;b&gt;ServiceOwnerName&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Click &lt;b&gt;Create&lt;/b&gt; to create the new service, and then click &lt;b&gt;New&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Enter &lt;b&gt;ServerService&lt;/b&gt; for the service name.&lt;/li&gt;&lt;li&gt;Select the &lt;b&gt;ContractNames&lt;/b&gt; drop-down and select the Shipping contract.&lt;/li&gt;&lt;li&gt;Select the &lt;b&gt;QueueName&lt;/b&gt; drop-down menu and select the ServerQueue queue.&lt;/li&gt;&lt;li&gt;Enter or select a &lt;b&gt;ServiceOwnerName&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Click &lt;b&gt;Create&lt;/b&gt; to create the new service.&lt;/li&gt;
&lt;/ol&gt;&lt;h6&gt;
To create services with RemoteServiceBinding enabled
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Click &lt;b&gt;New&lt;/b&gt;, and then click &lt;b&gt;Service&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Enter &lt;b&gt;RemoteService&lt;/b&gt; for the service name.&lt;/li&gt;&lt;li&gt;Select the &lt;b&gt;ContractNames&lt;/b&gt; drop-down menu and select the Shipping contract.&lt;/li&gt;&lt;li&gt;Set EnableRemoteService to true.&lt;/li&gt;&lt;li&gt;Select the &lt;b&gt;QueueName&lt;/b&gt; drop-down menu and select the ClientQueue queue.&lt;/li&gt;&lt;li&gt;Enter or select a &lt;b&gt;ServiceOwnerName&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Click &lt;b&gt;Create&lt;/b&gt; to create the new service, and then click &lt;b&gt;New&lt;/b&gt;.&lt;/li&gt;
&lt;/ol&gt;&lt;h6&gt;
To enable anonymous access for a Remote Service
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Select &lt;b&gt;RemoteService within the object tree&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Set AllowAnonymous to True.&lt;/li&gt;&lt;li&gt;Click &lt;b&gt;Alter&lt;/b&gt; to alter the service.&lt;/li&gt;
&lt;/ol&gt;&lt;h6&gt;
To create a Target Instance Endpoint
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Click &lt;b&gt;New&lt;/b&gt;, and then click &lt;b&gt;Target Instance Endpoint&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Enter a name, or accept the default name.&lt;/li&gt;&lt;li&gt;Click &lt;b&gt;Create&lt;/b&gt;.&lt;/li&gt;
&lt;/ol&gt;&lt;h6&gt;
To set a script export path
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Click the &lt;b&gt;Object&lt;/b&gt; tab if this tab is not already active.&lt;/li&gt;&lt;li&gt;Click &lt;b&gt;Options&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Enter a valid ScriptPath.&lt;/li&gt;&lt;li&gt;Click &lt;b&gt;Create&lt;/b&gt;.&lt;/li&gt;
&lt;/ol&gt;&lt;h6&gt;
To export an object
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Select an object within the objects tree.&lt;/li&gt;&lt;li&gt;Click &lt;b&gt;Script&lt;/b&gt; then &lt;b&gt;Export&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;The object is exported to the ScriptPath set in Application Configuration.&lt;/li&gt;
&lt;/ol&gt;&lt;h6&gt;
To export a Service definition to a file
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Select a service from within the Objects tree.&lt;/li&gt;&lt;li&gt;Click &lt;b&gt;Script&lt;/b&gt;, and then click &lt;b&gt;Export&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;The service script is exported to the ScriptPath set in Application Configuration.&lt;/li&gt;
&lt;/ol&gt;&lt;h6&gt;
To drop an object
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Select the object in the TreeView.&lt;/li&gt;&lt;li&gt;Click either &lt;b&gt;Drop&lt;/b&gt; or &lt;b&gt;Edit&lt;/b&gt;, &lt;b&gt;Drop {ObjectName}.&lt;/b&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;h6&gt;
To alter an object
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Click the object in the Objects tree that you want to modify.&lt;/li&gt;&lt;li&gt;Modify the properties of that object.&lt;/li&gt;&lt;li&gt;Click &lt;b&gt;Alter&lt;/b&gt; to alter the object.&lt;/li&gt;
&lt;/ol&gt;&lt;h6&gt;
To query data describing an object
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Each object can output data describing the object to a Textbox and/or DataGrid.&lt;/li&gt;&lt;li&gt;Select an object in the TreeView.&lt;/li&gt;&lt;li&gt;Click Query.&lt;/li&gt;
&lt;/ol&gt;&lt;h3&gt;
Removing the Sample
&lt;/h3&gt; &lt;br /&gt;&lt;h6&gt;
To drop services
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Click the ClientService node.&lt;/li&gt;&lt;li&gt;Drop the object.&lt;/li&gt;&lt;li&gt;Click the ServerService node.&lt;/li&gt;&lt;li&gt;Drop the object.&lt;/li&gt;&lt;li&gt;Click the RemoteService node.&lt;/li&gt;&lt;li&gt;Drop the object.&lt;/li&gt;
&lt;/ol&gt;&lt;h6&gt;
To drop queues
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Click the ClientQueue node.&lt;/li&gt;&lt;li&gt;Drop the object.&lt;/li&gt;&lt;li&gt;Click the ServerQueue node.&lt;/li&gt;&lt;li&gt;Drop the object.&lt;/li&gt;
&lt;/ol&gt;&lt;h6&gt;
To drop contracts
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Click the Shipping contract node.&lt;/li&gt;&lt;li&gt;Drop the object.&lt;/li&gt;
&lt;/ol&gt;&lt;h6&gt;
To drop MessageTypes
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Click the ShippingRequest MessageType node.&lt;/li&gt;&lt;li&gt;Drop the object.&lt;/li&gt;&lt;li&gt;Click the ShippingAccept MessageType node.&lt;/li&gt;&lt;li&gt;Drop the object.&lt;/li&gt;&lt;li&gt;Click the ShippingComplete MessageType node.&lt;/li&gt;&lt;li&gt;Drop the object.&lt;/li&gt;
&lt;/ol&gt;&lt;h6&gt;
To drop a Target Instance Endpoint
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Click a Target Instance Endpoint node.&lt;/li&gt;&lt;li&gt;Drop the object. &amp;#169; 2008 Microsoft Corporation. All rights reserved.&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description><author>cmslydia</author><pubDate>Thu, 02 Apr 2009 02:52:05 GMT</pubDate><guid isPermaLink="false">Updated Wiki: SS2008!Readme_ServiceBrokerConfiguration 20090402025205A</guid></item><item><title>Updated Wiki: SS2008!Large Binary Object (LOB) Handling</title><link>http://msftengprodsamples.codeplex.com/Wiki/View.aspx?title=SS2008!Large Binary Object (LOB) Handling&amp;version=10</link><description>&lt;div class="wikidoc"&gt;
&lt;h2&gt;
Readme_Large Object (LOB) Handling Sample
&lt;/h2&gt; &lt;br /&gt; 11/05/2008 21:36:06&lt;br /&gt;  &lt;br /&gt; &lt;br /&gt; This sample works only with SQL Server 2005 and SQL Server 2008. It will not work with any version of SQL Server earlier than SQL Server 2005. &lt;br /&gt;The HandlingLOBUsingCLR sample for SQL Server demonstrates transferring large objects (LOBs) between SQL Server and a file system that is available to the server by using common language runtime (CLR) stored procedures. This sample demonstrates how to access files in server-side code, and then invoke both dynamic queries and stored procedures from CLR-based stored procedures. It also demonstrates how to unregister and register CLR methods and assemblies by using Transact-SQL.&lt;br /&gt; &lt;br /&gt;&lt;table&gt;
&lt;tr&gt;
&lt;th&gt; Note:  &lt;/th&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;td&gt;  When you compile SQLCLR samples, the path of the version of the .NET Framework compiler that was distributed with SQL Server must be the first Framework directory in the PATH environment variable. The location of the compiler that is included with SQL Server will be either &lt;i&gt;drive&lt;/i&gt;:\WINNT\Microsoft.NET\Framework\v2.0.&lt;i&gt;xxxxx&lt;/i&gt; or &lt;i&gt;drive&lt;/i&gt;:\Windows\Microsoft.NET\Framework\v2.0.&lt;i&gt;xxxxx&lt;/i&gt;, where &lt;i&gt;drive&lt;/i&gt; is the installation drive and &lt;i&gt;xxxxx&lt;/i&gt; is the version number of the .NET Framework that was included with SQL Server. &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt; &lt;br /&gt; &lt;br /&gt;The default installation directory is C:\Program Files\Microsoft SQL Server\100\Samples\Engine\Programmability\CLR\HandlingLOBUsingCLR.&lt;br /&gt; SQL Server samples and sample databases must be downloaded and installed before you can view or work with them. For more information, see &lt;i&gt;Considerations for Installing SQL Server Samples and Sample Databases&lt;/i&gt;.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Scenario
&lt;/h3&gt;A developer wants to copy images between SQL Server and the file system on the server.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Languages
&lt;/h3&gt; Transact-SQL, Visual C#, and Visual Basic.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Features
&lt;/h3&gt;The HandlingLOBUsingCLR sample uses the following features of SQL Server:&lt;br /&gt; &lt;br /&gt;&lt;table&gt;
&lt;tr&gt;
&lt;th&gt;  Application Area &lt;/th&gt;&lt;th&gt;  Features  &lt;/th&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;td&gt; Overall&lt;/td&gt;&lt;td&gt; CLR stored procedures; calling Transact-SQL stored procedures from CLR stored procedures; the VARBINARY(MAX) data type. &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt; &lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Prerequisites
&lt;/h3&gt;Before running this sample, make sure the following software is installed:&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt; SQL Server or SQL Server Express. You can obtain SQL Server Express free of charge from the SQL Server Express Documentation and Samples &lt;a href="http://go.microsoft.com/fwlink/?LinkId=31046" class="externalLink"&gt;Web site&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;  &lt;/li&gt;&lt;li&gt; The AdventureWorks database that is available at the SQL Server Developer &lt;a href="http://go.microsoft.com/fwlink/?linkid=62796" class="externalLink"&gt;Web site&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.  &lt;/li&gt;&lt;li&gt; The SQL Server Database Engine samples that are available at the SQL Server Developer &lt;a href="http://go.microsoft.com/fwlink/?linkid=62796" class="externalLink"&gt;Web site&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.  &lt;/li&gt;&lt;li&gt; .NET Framework SDK 2.0 or Microsoft Visual Studio 2005. You can obtain .NET Framework SDK free of charge. See &lt;b&gt;Installing the .NET Framework Documentation&lt;/b&gt;.  &lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;
Building the Sample
&lt;/h3&gt;If you have not already created the strong-name key file &lt;b&gt;ExternalSampleKey.snk&lt;/b&gt;, generate the key file using the following instructions. &lt;br /&gt; &lt;br /&gt;&lt;h6&gt;
To generate a strong name key file
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Open a Visual Studio 2005 command prompt. Click &lt;b&gt;Start&lt;/b&gt;, point to &lt;b&gt;All Programs&lt;/b&gt;, point to &lt;b&gt;Microsoft Visual Studio 2005&lt;/b&gt;, point to &lt;b&gt;Visual Studio Tools&lt;/b&gt;, and then click &lt;b&gt;Visual Studio 2005 Command Prompt&lt;/b&gt;.—Or—Open a.NET Framework command prompt. Click &lt;b&gt;Start&lt;/b&gt;, point to &lt;b&gt;All Programs&lt;/b&gt;, point to &lt;b&gt;Microsoft .NET Framework SDK 2.0&lt;/b&gt;, and then click &lt;b&gt;SDK Command Prompt&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;At the command prompt, use the change directory (CD) command to change the current folder of the command prompt window to the Samples folder.  &lt;b&gt;Note:   To determine the folder where samples are located, click &lt;b&gt;Start&lt;/b&gt;, point to &lt;b&gt;All Programs&lt;/b&gt;, point to &lt;b&gt;Microsoft SQL Server&lt;/b&gt;, point to &lt;b&gt;Documentation and Tutorials&lt;/b&gt;, and then click &lt;b&gt;Samples Directory&lt;/b&gt;. If the default installation location was used, the samples are located in &amp;lt;&lt;i&gt;system&lt;/i&gt;drive_&amp;gt;:\Program Files\Microsoft SQL Server\100\Samples.&lt;/b&gt;&lt;/li&gt;&lt;li&gt;At the command prompt, run the following command to generate the key file: &lt;span class="codeInline"&gt;sn -k ExternalSampleKey.snk&lt;/span&gt; ** &lt;b&gt;Important:   For more information about the strong-name key pair, see &amp;quot;Security Briefs: Strong Names and Security in the .NET Framework&amp;quot; in the .NET Development Center on MSDN.&lt;/b&gt;To build the sample, do the following:&lt;/li&gt;
&lt;/ol&gt; &lt;br /&gt;&lt;h6&gt;
Build the sample
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Compile the sample by using Visual Studio 2005 and the provided Visual Studio solution, or by using MSBuild, which is included in the .NET Framework SDK 2.0. Run a command similar to the following at the command prompt: &lt;span class="codeInline"&gt;msbuild /nologo /verbosity:quiet /property:Configuration=Debug CS\HandlingLOBUsingCLR.sln&lt;/span&gt; &lt;/li&gt;&lt;li&gt;Make sure that the AdventureWorks database is installed.&lt;/li&gt;&lt;li&gt;If you did not install the SQL Server Database Engine samples in the default location, modify the path in the CREATE ASSEMBLY part of the script in Scripts\InstallCS.sql and Scripts\InstallVB.sql to refer to location where the samples were installed.&lt;/li&gt;&lt;li&gt;If you are not an administrator for the SQL Server instance you are using, you must have an administrator grant you &lt;b&gt;CreateAssembly&lt;/b&gt; permission to complete the installation.&lt;/li&gt;&lt;li&gt;Open the scripts\installCS.sql or scripts\installVB.sql file, depending on whether you compiled the Visual C# project or the Visual Basic project, in SQL Server Management Studio. Run the script that is contained in the file, or run a command similar to the following at the command prompt: &lt;span class="codeInline"&gt;sqlcmd -E -I -i Scripts\InstallCS.sql&lt;/span&gt;&lt;/li&gt;&lt;li&gt; Removes any stored procedures that are about to be defined, if they exist.  &lt;/li&gt;&lt;li&gt; Drops the assembly registration, if it already exists.  &lt;/li&gt;&lt;li&gt; Registers the assembly.  &lt;/li&gt;&lt;li&gt; Registers the CLR stored procedures.  &lt;/li&gt;&lt;li&gt; Creates the Transact-SQL stored procedure called by one of the CLR stored procedures.  &lt;/li&gt;
&lt;/ol&gt;&lt;h3&gt;
Running the Sample
&lt;/h3&gt;To run the sample, do the following:&lt;br /&gt; &lt;br /&gt;&lt;h6&gt;
Run the sample
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;To read an image from the database, invoke a script similar to the following: &lt;span class="codeInline"&gt;exec GetPhotoFromDB 70, 'C:\Temp\', 'test6.gif'&lt;/span&gt;  &lt;span class="codeInline"&gt;go&lt;/span&gt; Make sure the directory you specify exists.&lt;/li&gt;&lt;li&gt;To write an image into the database, invoke a script similar to the following: &lt;span class="codeInline"&gt;exec PutPhotoIntoDB 70, 'C:\Temp\', 'test1.gif'&lt;/span&gt;  &lt;span class="codeInline"&gt;go&lt;/span&gt; Any errors will be reported to the error.log file in the directory that you specify. For scripts that are similar to the ones in this procedure, see the Scripts\test.sql file.&lt;/li&gt;
&lt;/ol&gt;&lt;h3&gt;
Removing the Sample
&lt;/h3&gt;To remove the sample, do the following:&lt;br /&gt; &lt;br /&gt;&lt;h6&gt;
Remove the sample
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Open the scripts\cleanup.sql file in Management Studio and run the script that is contained in the file. Or, run the following command at the command prompt: &lt;span class="codeInline"&gt;sqlcmd -E -I -i Scripts\cleanup.sql&lt;/span&gt; &lt;/li&gt;
&lt;/ol&gt;&lt;h3&gt;
Comments
&lt;/h3&gt;The CLR for SQL Server or SQL Server Express must be enabled for this sample to work correctly.&lt;br /&gt; Samples are provided for educational purposes only. They are not intended to be used in a production environment and have not been tested in a production environment. Microsoft does not provide technical support for these samples. Sample applications and assemblies should not be connected to or used with your production SQL Server database or your report server without the permission of the system administrator. &lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
See Also
&lt;/h3&gt; &lt;br /&gt;&lt;h6&gt;
Concepts
&lt;/h6&gt;&lt;i&gt;CLR Programmability Samples&lt;/i&gt;  &lt;br /&gt;&lt;h6&gt;
Other Resources
&lt;/h6&gt;&lt;b&gt;Common Language Runtime (CLR) Integration Programming Concepts&lt;/b&gt;    &lt;br /&gt;&lt;h6&gt;
 Help and Information
&lt;/h6&gt;&lt;ul&gt;
&lt;li&gt;Getting SQL Server 2008 Assistance* &amp;#169; 2008 Microsoft Corporation. All rights reserved.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</description><author>libinzhao</author><pubDate>Thu, 02 Apr 2009 02:48:47 GMT</pubDate><guid isPermaLink="false">Updated Wiki: SS2008!Large Binary Object (LOB) Handling 20090402024847A</guid></item><item><title>Updated Wiki: SS2008!Readme_VerifyBackup</title><link>http://msftengprodsamples.codeplex.com/Wiki/View.aspx?title=SS2008!Readme_VerifyBackup&amp;version=11</link><description>&lt;div class="wikidoc"&gt;
&lt;h2&gt;
Readme_VerifyBackup Sample
&lt;/h2&gt; &lt;br /&gt; 11/05/2008 21:36:06&lt;br /&gt;  &lt;br /&gt; &lt;br /&gt; This sample works only with SQL Server 2005 and SQL Server 2008. It will not work with any version of SQL Server earlier than SQL Server 2005. &lt;br /&gt;This sample demonstrates techniques for verifying a backup on a backup device to ensure the data can be used to restore the appropriate databases. By using SQL Server Management Object (SMO) capabilities of Microsoft SQL Server, this application lets users select the backup device and verify the contents of the selected backup. This sample provides a user interface that lets the user specify the SQL Server instance to connect to and whether to use Windows Authentication. The user can then select which database and backup file location and name.&lt;br /&gt; Samples are provided for educational purposes only. They are not intended to be used in a production environment and have not been tested in a production environment. Microsoft does not provide technical support for these samples. Sample applications and assemblies should not be connected to or used with your production SQL Server database or your report server without the permission of the system administrator. &lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Requirements
&lt;/h3&gt;This sample requires that the following components are installed.&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt; .NET Framework SDK 2.0 or Microsoft Visual Studio 2005. You can obtain .NET Framework SDK free of charge. See &lt;b&gt;Installing the .NET Framework Documentation&lt;/b&gt;.  &lt;/li&gt;&lt;li&gt; The sample package and data files that it uses must be installed on the local hard disk drive.   &lt;/li&gt;&lt;li&gt; The &lt;b&gt;AdventureWorks&lt;/b&gt; database must be installed.  &lt;/li&gt;&lt;li&gt; You must have administrative permissions on the &lt;b&gt;AdventureWorks&lt;/b&gt; database.   &lt;/li&gt;&lt;li&gt; You must compile the ServerConnect component first, because this sample has a dependency on the ServerConnect sample.   &lt;/li&gt;&lt;li&gt; Run the script &amp;quot;CreateDevicesAndBackups.sql&amp;quot; to create Devices And Backups.   &lt;/li&gt;
&lt;/ul&gt; &lt;br /&gt;&lt;h3&gt;
Location
&lt;/h3&gt;If the code sample was installed to the default location, the sample is located in the following directory:&lt;br /&gt; C:\Program Files\Microsoft SQL Server\100\Samples\Engine\Programmability\SMO\VerifyBackup&lt;br /&gt;The C# solution for the code sample is located in the CS directory, and the Visual Basic solution is located in the VB directory.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Building the Sample
&lt;/h3&gt;If you have not already created a strong name key file, generate the key file using the following instructions.&lt;br /&gt; &lt;br /&gt;&lt;h6&gt;
 To generate a strong name key file
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Open a Microsoft Visual Studio 2005 command prompt. Click &lt;b&gt;Start&lt;/b&gt;, point to &lt;b&gt;All Programs&lt;/b&gt;, point to &lt;b&gt;Microsoft .NET Framework SDK 2.0&lt;/b&gt;, and then click &lt;b&gt;SDK Command Prompt&lt;/b&gt;.-- or --Open a Microsoft .NET Framework command prompt. Click &lt;b&gt;Start&lt;/b&gt;, point to &lt;b&gt;All Programs&lt;/b&gt;, point to &lt;b&gt;Microsoft .NET Framework SDK 2.0&lt;/b&gt;, and then click &lt;b&gt;SDK Command Prompt&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Use the change directory command (CD) to change the current directory of the command prompt window to the folder where the samples are installed. &lt;b&gt;Note: To determine the folder where samples are located, click the &lt;b&gt;Start&lt;/b&gt; button, point to &lt;b&gt;All Programs&lt;/b&gt;, point to &lt;b&gt;Microsoft SQL Server&lt;/b&gt;, point to &lt;b&gt;Documentation and Tutorials&lt;/b&gt;, and then click &lt;b&gt;Samples Directory&lt;/b&gt;. If the default installation location was used, the samples are located in &amp;lt;system_drive&amp;gt;:\Program Files\Microsoft SQL Server\100\Samples.&lt;/b&gt;&lt;/li&gt;&lt;li&gt;At the command prompt, run the following command to generate the key file: &lt;span class="codeInline"&gt;sn -k SampleKey.snk&lt;/span&gt;  &lt;b&gt;Important: For more information about the strong-name key pair, see &amp;quot;Security Briefs: Strong Names and Security in the .NET Framework&amp;quot; in the .NET Development Center on MSDN.&lt;/b&gt;&lt;/li&gt;
&lt;/ol&gt; &lt;br /&gt;&lt;h6&gt;
Building and using the sample using the Command Line Compiler
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Open a .NET Framework or Microsoft Visual Studio 2005 command prompt. Use the change directory (CD) command to change the current directory of the command prompt window to the solution directory that you want to work in.&lt;/li&gt;&lt;li&gt;Type the following command to build either the C# or the Visual Basic version of the sample: &lt;span class="codeInline"&gt;for /r %f in (*.sln) do msbuild.exe &amp;quot;%f&amp;quot;&lt;/span&gt; &lt;/li&gt;
&lt;/ol&gt;&lt;h6&gt;
Building and using the sample from Microsoft Visual Studio 2005 (optional)
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;From the &lt;b&gt;File&lt;/b&gt; menu in Microsoft Visual Studio 2005, click &lt;b&gt;Open&lt;/b&gt;, click &lt;b&gt;Project&lt;/b&gt;, and then open &lt;b&gt;VerifyBackup.sln&lt;/b&gt; in the solution directory that you want to work in.&lt;/li&gt;&lt;li&gt;Press &lt;b&gt;F5&lt;/b&gt;, or click &lt;b&gt;Start&lt;/b&gt; on the &lt;b&gt;Debug&lt;/b&gt; menu to compile and run the project. &amp;#169; 2008 Microsoft Corporation. All rights reserved.&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description><author>leilu</author><pubDate>Fri, 27 Mar 2009 02:35:56 GMT</pubDate><guid isPermaLink="false">Updated Wiki: SS2008!Readme_VerifyBackup 20090327023556A</guid></item><item><title>Updated Wiki: SS2008!Readme_UtilityConversion</title><link>http://msftengprodsamples.codeplex.com/Wiki/View.aspx?title=SS2008!Readme_UtilityConversion&amp;version=9</link><description>&lt;div class="wikidoc"&gt;
&lt;h2&gt;
Readme_UtilityConversion Sample
&lt;/h2&gt; &lt;br /&gt; 08/06/2008 01:27:32&lt;br /&gt;  &lt;br /&gt; &lt;br /&gt; This sample works only with SQL Server 2005 and SQL Server 2008. It will not work with any version of SQL Server earlier than SQL Server 2005. &lt;br /&gt;This sample demonstrates techniques for implementing assembly functions (SQLCLR) in database applications. By using SQL Server common language runtime (CLR) capabilities of Microsoft SQL Server, this application lets users run CLR assembly code from within SQL Server. This sample provides sample code to perform various datatype conversions.&lt;br /&gt; Samples are provided for educational purposes only. They are not intended to be used in a production environment and have not been tested in a production environment. Microsoft does not provide technical support for these samples. Sample applications and assemblies should not be connected to or used with your production SQL Server database or your report server without the permission of the system administrator. &lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Requirements
&lt;/h3&gt;This sample requires that the following components are installed.&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt; .NET Framework SDK 2.0 or Microsoft Visual Studio 2005. You can obtain .NET Framework SDK free of charge. See &lt;b&gt;Installing the .NET Framework Documentation&lt;/b&gt;.  &lt;/li&gt;&lt;li&gt; Integration Services.  &lt;/li&gt;&lt;li&gt; The sample package and data files that it uses must be installed on the local hard disk drive.   &lt;/li&gt;&lt;li&gt; The &lt;b&gt;AdventureWorks&lt;/b&gt; OLTP database must be installed.  &lt;/li&gt;&lt;li&gt; The &lt;b&gt;AdventureWorks&lt;/b&gt; database must be attached.  &lt;/li&gt;&lt;li&gt; You must have administrative permissions on the &lt;b&gt;AdventureWorks&lt;/b&gt; database.   &lt;/li&gt;&lt;li&gt; This sample is used by the LoadRegAssembly.exe from the LoadRegAssembly project.  For more information about how to install samples, see &amp;quot;Installing Sample Integration Services Packages&amp;quot; in SQL Server Books Online.&lt;/li&gt;
&lt;/ul&gt; &lt;br /&gt;&lt;h3&gt;
Location
&lt;/h3&gt;If the code sample was installed to the default location, the sample is located in the following directory:&lt;br /&gt; C:\Program Files\Microsoft SQL Server\100\Samples\Engine\Programmability\SMO\UtilityConversion&lt;br /&gt;The C# solution for the code sample is located in the CS directory, and the Visual Basic solution is located in the VB directory.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Building the Sample
&lt;/h3&gt;If you have not already created a strong name key file, generate the key file using the following instructions.&lt;br /&gt; &lt;br /&gt;&lt;h6&gt;
 To generate a strong name key file
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Open a Microsoft Visual Studio 2005 command prompt. Click &lt;b&gt;Start&lt;/b&gt;, point to &lt;b&gt;All Programs&lt;/b&gt;, point to &lt;b&gt;Microsoft .NET Framework SDK 2.0&lt;/b&gt;, and then click &lt;b&gt;SDK Command Prompt&lt;/b&gt;.-- or --Open a Microsoft .NET Framework command prompt. Click &lt;b&gt;Start&lt;/b&gt;, point to &lt;b&gt;All Programs&lt;/b&gt;, point to &lt;b&gt;Microsoft .NET Framework SDK 2.0&lt;/b&gt;, and then click &lt;b&gt;SDK Command Prompt&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Use the change directory command (CD) to change the current directory of the command prompt window to the folder where the samples are installed. &lt;b&gt;Note: To determine the folder where samples are located, click the &lt;b&gt;Start&lt;/b&gt; button, point to &lt;b&gt;All Programs&lt;/b&gt;, point to &lt;b&gt;Microsoft SQL Server&lt;/b&gt;, point to &lt;b&gt;Documentation and Tutorials&lt;/b&gt;, and then click &lt;b&gt;Samples Directory&lt;/b&gt;. If the default installation location was used, the samples are located in &amp;lt;system_drive&amp;gt;:\Program Files\Microsoft SQL Server\100\Samples.&lt;/b&gt;&lt;/li&gt;&lt;li&gt;At the command prompt, run the following command to generate the key file: &lt;span class="codeInline"&gt;sn -k SampleKey.snk&lt;/span&gt;  &lt;b&gt;Important: For more information about the strong-name key pair, see &amp;quot;Security Briefs: Strong Names and Security in the .NET Framework&amp;quot; in the .NET Development Center on MSDN.&lt;/b&gt;&lt;/li&gt;
&lt;/ol&gt; &lt;br /&gt;&lt;h6&gt;
Building and using the sample using the Command Line Compiler
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Open a .NET Framework or Microsoft Visual Studio 2005 command prompt. Use the change directory (CD) command to change the current directory of the command prompt window to the solution directory that you want to work in.&lt;/li&gt;&lt;li&gt;Type the following command to build either the C# or the Visual Basic version of the sample: &lt;span class="codeInline"&gt;for /r %f in (*.sln) do msbuild.exe &amp;quot;%f&amp;quot;&lt;/span&gt; &lt;/li&gt;
&lt;/ol&gt;&lt;h6&gt;
Building and using the sample from Microsoft Visual Studio 2005 (optional)
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;From the &lt;b&gt;File&lt;/b&gt; menu in Microsoft Visual Studio 2005, click &lt;b&gt;Open&lt;/b&gt;, click &lt;b&gt;Project&lt;/b&gt;, and then open &lt;b&gt;UtilityConversion.sln&lt;/b&gt; in the solution directory that you want to work in.&lt;/li&gt;&lt;li&gt;Press Ctrl+Shift+B, or click &lt;b&gt;Build Solution&lt;/b&gt; on the &lt;b&gt;Build&lt;/b&gt; menu to compile the sample. &amp;#169; 2008 Microsoft Corporation. All rights reserved.&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description><author>cmslydia</author><pubDate>Fri, 20 Mar 2009 02:57:14 GMT</pubDate><guid isPermaLink="false">Updated Wiki: SS2008!Readme_UtilityConversion 20090320025714A</guid></item><item><title>Updated Wiki: SS2008!Readme_ServerConnect</title><link>http://msftengprodsamples.codeplex.com/Wiki/View.aspx?title=SS2008!Readme_ServerConnect&amp;version=13</link><description>&lt;div class="wikidoc"&gt;
&lt;h2&gt;
Readme_ServerConnect Sample
&lt;/h2&gt; &lt;br /&gt; 11/05/2008 21:36:06&lt;br /&gt;  &lt;br /&gt; &lt;br /&gt; This sample works only with SQL Server 2005 and SQL Server 2008. It will not work with any version of SQL Server earlier than SQL Server 2005. &lt;br /&gt;This sample demonstrates techniques for implementing SQL Server listing and login capabilities into database applications. By using SQL Server Management Object (SMO) capabilities of Microsoft SQL Server, this application lets users log on to the selected database. This sample provides a user interface that permits specifying the SQL Server instance to connect to and whether to use Windows Authentication.&lt;br /&gt; Samples are provided for educational purposes only. They are not intended to be used in a production environment and have not been tested in a production environment. Microsoft does not provide technical support for these samples. Sample applications and assemblies should not be connected to or used with your production SQL Server database or your report server without the permission of the system administrator. &lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Requirements
&lt;/h3&gt;This sample requires that the following components are installed.&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt; .NET Framework SDK 2.0 or Microsoft Visual Studio 2005. You can obtain .NET Framework SDK free of charge. See &lt;b&gt;Installing the .NET Framework Documentation&lt;/b&gt;.  &lt;/li&gt;&lt;li&gt; The sample package and data files that it uses must be installed on the local hard disk drive.   &lt;/li&gt;
&lt;/ul&gt;  For more information about how to install samples, see &amp;quot;Installing Sample Integration Services Packages&amp;quot; in SQL Server Books Online.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Location
&lt;/h3&gt;If the code sample was installed to the default location, the sample is located in the following directory:&lt;br /&gt; C:\Program Files\Microsoft SQL Server\100\Samples\Engine\Programmability\SMO\ServerConnect&lt;br /&gt;The C# solution for the code sample is located in the CS directory, and the Visual Basic solution is located in the VB directory.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Building the Sample
&lt;/h3&gt;If you have not already created a strong name key file, generate the key file using the following instructions.&lt;br /&gt; &lt;br /&gt;&lt;h6&gt;
 To generate a strong name key file
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Open a Microsoft Visual Studio 2005 command prompt. Click &lt;b&gt;Start&lt;/b&gt;, point to &lt;b&gt;All Programs&lt;/b&gt;, point to &lt;b&gt;Microsoft .NET Framework SDK 2.0&lt;/b&gt;, and then click &lt;b&gt;SDK Command Prompt&lt;/b&gt;.-- or --Open a Microsoft .NET Framework command prompt. Click &lt;b&gt;Start&lt;/b&gt;, point to &lt;b&gt;All Programs&lt;/b&gt;, point to &lt;b&gt;Microsoft .NET Framework SDK 2.0&lt;/b&gt;, and then click &lt;b&gt;SDK Command Prompt&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Use the change directory command (CD) to change the current directory of the command prompt window to the folder where the samples are installed. &lt;b&gt;Note: To determine the folder where samples are located, click the &lt;b&gt;Start&lt;/b&gt; button, point to &lt;b&gt;All Programs&lt;/b&gt;, point to &lt;b&gt;Microsoft SQL Server&lt;/b&gt;, point to &lt;b&gt;Documentation and Tutorials&lt;/b&gt;, and then click &lt;b&gt;Samples Directory&lt;/b&gt;. If the default installation location was used, the samples are located in &amp;lt;system_drive&amp;gt;:\Program Files\Microsoft SQL Server\100\Samples.&lt;/b&gt;&lt;/li&gt;&lt;li&gt;At the command prompt, run the following command to generate the key file: &lt;span class="codeInline"&gt;sn -k SampleKey.snk&lt;/span&gt;  &lt;b&gt;Important: For more information about the strong-name key pair, see &amp;quot;Security Briefs: Strong Names and Security in the .NET Framework&amp;quot; in the .NET Development Center on MSDN.&lt;/b&gt;&lt;/li&gt;
&lt;/ol&gt; &lt;br /&gt;&lt;h6&gt;
Building and using the sample using the Command Line Compiler
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Open a .NET Framework or Microsoft Visual Studio 2005 command prompt. Use the change directory (CD) command to change the current directory of the command prompt window to the solution directory that you want to work in.&lt;/li&gt;&lt;li&gt;Type the following command to build either the C# or the Visual Basic version of the sample: &lt;span class="codeInline"&gt;for /r %f in (*.sln) do msbuild.exe &amp;quot;%f&amp;quot;&lt;/span&gt; &lt;/li&gt;
&lt;/ol&gt;&lt;h6&gt;
Building and using the sample from Microsoft Visual Studio 2005 (optional)
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;From the &lt;b&gt;File&lt;/b&gt; menu in Microsoft Visual Studio 2005, click &lt;b&gt;Open&lt;/b&gt;, click &lt;b&gt;Project&lt;/b&gt;, and then open &lt;b&gt;ServerConnect.sln&lt;/b&gt; in the solution directory that you want to work in.&lt;/li&gt;&lt;li&gt;Press Ctrl+Shift+B, or click &lt;b&gt;Build Solution&lt;/b&gt; on the &lt;b&gt;Build&lt;/b&gt; menu to compile the sample. &amp;#169; 2008 Microsoft Corporation. All rights reserved.&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description><author>cmslydia</author><pubDate>Fri, 20 Mar 2009 02:51:24 GMT</pubDate><guid isPermaLink="false">Updated Wiki: SS2008!Readme_ServerConnect 20090320025124A</guid></item><item><title>Updated Wiki: SS2008!Readme_ServerConnect</title><link>http://msftengprodsamples.codeplex.com/Wiki/View.aspx?title=SS2008!Readme_ServerConnect&amp;version=12</link><description>&lt;div class="wikidoc"&gt;
&lt;h2&gt;
Readme_ServerConnect Sample
&lt;/h2&gt; &lt;br /&gt; 11/05/2008 21:36:06&lt;br /&gt;  &lt;br /&gt; &lt;br /&gt; This sample works only with SQL Server 2005 and SQL Server 2008. It will not work with any version of SQL Server earlier than SQL Server 2005. &lt;br /&gt;This sample demonstrates techniques for implementing SQL Server listing and login capabilities into database applications. By using SQL Server Management Object (SMO) capabilities of Microsoft SQL Server, this application lets users log on to the selected database. This sample provides a user interface that permits specifying the SQL Server instance to connect to and whether to use Windows Authentication.&lt;br /&gt; Samples are provided for educational purposes only. They are not intended to be used in a production environment and have not been tested in a production environment. Microsoft does not provide technical support for these samples. Sample applications and assemblies should not be connected to or used with your production SQL Server database or your report server without the permission of the system administrator. &lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Requirements
&lt;/h3&gt;This sample requires that the following components are installed.&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt; .NET Framework SDK 2.0 or Microsoft Visual Studio 2005. You can obtain .NET Framework SDK free of charge. See &lt;b&gt;Installing the .NET Framework Documentation&lt;/b&gt;.  &lt;/li&gt;&lt;li&gt; The sample package and data files that it uses must be installed on the local hard disk drive.   &lt;/li&gt;
&lt;/ul&gt;  For more information about how to install samples, see &amp;quot;Installing Sample Integration Services Packages&amp;quot; in SQL Server Books Online.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Location
&lt;/h3&gt;If the code sample was installed to the default location, the sample is located in the following directory:&lt;br /&gt; C:\Program Files\Microsoft SQL Server\100\Samples\Engine\Programmability\SMO\ServerConnect&lt;br /&gt;The C# solution for the code sample is located in the CS directory, and the Visual Basic solution is located in the VB directory.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Building the Sample
&lt;/h3&gt;If you have not already created a strong name key file, generate the key file using the following instructions.&lt;br /&gt; &lt;br /&gt;&lt;h6&gt;
 To generate a strong name key file
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Open a Microsoft Visual Studio 2005 command prompt. Click &lt;b&gt;Start&lt;/b&gt;, point to &lt;b&gt;All Programs&lt;/b&gt;, point to &lt;b&gt;Microsoft .NET Framework SDK 2.0&lt;/b&gt;, and then click &lt;b&gt;SDK Command Prompt&lt;/b&gt;.-- or --Open a Microsoft .NET Framework command prompt. Click &lt;b&gt;Start&lt;/b&gt;, point to &lt;b&gt;All Programs&lt;/b&gt;, point to &lt;b&gt;Microsoft .NET Framework SDK 2.0&lt;/b&gt;, and then click &lt;b&gt;SDK Command Prompt&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Use the change directory command (CD) to change the current directory of the command prompt window to the folder where the samples are installed. &lt;b&gt;Note: To determine the folder where samples are located, click the &lt;b&gt;Start&lt;/b&gt; button, point to &lt;b&gt;All Programs&lt;/b&gt;, point to &lt;b&gt;Microsoft SQL Server&lt;/b&gt;, point to &lt;b&gt;Documentation and Tutorials&lt;/b&gt;, and then click &lt;b&gt;Samples Directory&lt;/b&gt;. If the default installation location was used, the samples are located in &amp;lt;system_drive&amp;gt;:\Program Files\Microsoft SQL Server\100\Samples.&lt;/b&gt;&lt;/li&gt;&lt;li&gt;At the command prompt, run the following command to generate the key file: &lt;span class="codeInline"&gt;sn -k SampleKey.snk&lt;/span&gt;  &lt;b&gt;Important: For more information about the strong-name key pair, see &amp;quot;Security Briefs: Strong Names and Security in the .NET Framework&amp;quot; in the .NET Development Center on MSDN.&lt;/b&gt;&lt;/li&gt;
&lt;/ol&gt; &lt;br /&gt;&lt;h6&gt;
Building and using the sample using the Command Line Compiler
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Open a .NET Framework or Microsoft Visual Studio 2005 command prompt. Use the change directory (CD) command to change the current directory of the command prompt window to the solution directory that you want to work in.&lt;/li&gt;&lt;li&gt;Type the following command to build either the C# or the Visual Basic version of the sample: &lt;span class="codeInline"&gt;for /r %f in (*.sln) do msbuild.exe &amp;quot;%f&amp;quot;&lt;/span&gt; &lt;/li&gt;
&lt;/ol&gt;&lt;h6&gt;
Building and using the sample from Microsoft Visual Studio 2005 (optional)
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;From the &lt;b&gt;File&lt;/b&gt; menu in Microsoft Visual Studio 2005, click &lt;b&gt;Open&lt;/b&gt;, click &lt;b&gt;Project&lt;/b&gt;, and then open &lt;b&gt;ServerConnect.sln&lt;/b&gt; in the solution directory that you want to work in.&lt;/li&gt;&lt;li&gt;Press Ctrl{&lt;u&gt;Shift&lt;/u&gt;}B, or click &lt;b&gt;Build Solution&lt;/b&gt; on the &lt;b&gt;Build&lt;/b&gt; menu to compile the sample. &amp;#169; 2008 Microsoft Corporation. All rights reserved.&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description><author>cmslydia</author><pubDate>Fri, 20 Mar 2009 02:50:25 GMT</pubDate><guid isPermaLink="false">Updated Wiki: SS2008!Readme_ServerConnect 20090320025025A</guid></item><item><title>Updated Wiki: SS2008!Readme_ServerConnect</title><link>http://msftengprodsamples.codeplex.com/Wiki/View.aspx?title=SS2008!Readme_ServerConnect&amp;version=11</link><description>&lt;div class="wikidoc"&gt;
&lt;h2&gt;
Readme_ServerConnect Sample
&lt;/h2&gt; &lt;br /&gt; 11/05/2008 21:36:06&lt;br /&gt;  &lt;br /&gt; &lt;br /&gt; This sample works only with SQL Server 2005 and SQL Server 2008. It will not work with any version of SQL Server earlier than SQL Server 2005. &lt;br /&gt;This sample demonstrates techniques for implementing SQL Server listing and login capabilities into database applications. By using SQL Server Management Object (SMO) capabilities of Microsoft SQL Server, this application lets users log on to the selected database. This sample provides a user interface that permits specifying the SQL Server instance to connect to and whether to use Windows Authentication.&lt;br /&gt; Samples are provided for educational purposes only. They are not intended to be used in a production environment and have not been tested in a production environment. Microsoft does not provide technical support for these samples. Sample applications and assemblies should not be connected to or used with your production SQL Server database or your report server without the permission of the system administrator. &lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Requirements
&lt;/h3&gt;This sample requires that the following components are installed.&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt; .NET Framework SDK 2.0 or Microsoft Visual Studio 2005. You can obtain .NET Framework SDK free of charge. See &lt;b&gt;Installing the .NET Framework Documentation&lt;/b&gt;.  &lt;/li&gt;&lt;li&gt; The sample package and data files that it uses must be installed on the local hard disk drive.   &lt;/li&gt;
&lt;/ul&gt;  For more information about how to install samples, see &amp;quot;Installing Sample Integration Services Packages&amp;quot; in SQL Server Books Online.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Location
&lt;/h3&gt;If the code sample was installed to the default location, the sample is located in the following directory:&lt;br /&gt; C:\Program Files\Microsoft SQL Server\100\Samples\Engine\Programmability\SMO\ServerConnect&lt;br /&gt;The C# solution for the code sample is located in the CS directory, and the Visual Basic solution is located in the VB directory.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Building the Sample
&lt;/h3&gt;If you have not already created a strong name key file, generate the key file using the following instructions.&lt;br /&gt; &lt;br /&gt;&lt;h6&gt;
 To generate a strong name key file
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Open a Microsoft Visual Studio 2005 command prompt. Click &lt;b&gt;Start&lt;/b&gt;, point to &lt;b&gt;All Programs&lt;/b&gt;, point to &lt;b&gt;Microsoft .NET Framework SDK 2.0&lt;/b&gt;, and then click &lt;b&gt;SDK Command Prompt&lt;/b&gt;.-- or --Open a Microsoft .NET Framework command prompt. Click &lt;b&gt;Start&lt;/b&gt;, point to &lt;b&gt;All Programs&lt;/b&gt;, point to &lt;b&gt;Microsoft .NET Framework SDK 2.0&lt;/b&gt;, and then click &lt;b&gt;SDK Command Prompt&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Use the change directory command (CD) to change the current directory of the command prompt window to the folder where the samples are installed. &lt;b&gt;Note: To determine the folder where samples are located, click the &lt;b&gt;Start&lt;/b&gt; button, point to &lt;b&gt;All Programs&lt;/b&gt;, point to &lt;b&gt;Microsoft SQL Server&lt;/b&gt;, point to &lt;b&gt;Documentation and Tutorials&lt;/b&gt;, and then click &lt;b&gt;Samples Directory&lt;/b&gt;. If the default installation location was used, the samples are located in &amp;lt;system_drive&amp;gt;:\Program Files\Microsoft SQL Server\100\Samples.&lt;/b&gt;&lt;/li&gt;&lt;li&gt;At the command prompt, run the following command to generate the key file: &lt;span class="codeInline"&gt;sn -k SampleKey.snk&lt;/span&gt;  &lt;b&gt;Important: For more information about the strong-name key pair, see &amp;quot;Security Briefs: Strong Names and Security in the .NET Framework&amp;quot; in the .NET Development Center on MSDN.&lt;/b&gt;&lt;/li&gt;
&lt;/ol&gt; &lt;br /&gt;&lt;h6&gt;
Building and using the sample using the Command Line Compiler
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Open a .NET Framework or Microsoft Visual Studio 2005 command prompt. Use the change directory (CD) command to change the current directory of the command prompt window to the solution directory that you want to work in.&lt;/li&gt;&lt;li&gt;Type the following command to build either the C# or the Visual Basic version of the sample: &lt;span class="codeInline"&gt;for /r %f in (*.sln) do msbuild.exe &amp;quot;%f&amp;quot;&lt;/span&gt; &lt;/li&gt;
&lt;/ol&gt;&lt;h6&gt;
Building and using the sample from Microsoft Visual Studio 2005 (optional)
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;From the &lt;b&gt;File&lt;/b&gt; menu in Microsoft Visual Studio 2005, click &lt;b&gt;Open&lt;/b&gt;, click &lt;b&gt;Project&lt;/b&gt;, and then open &lt;b&gt;ServerConnect.sln&lt;/b&gt; in the solution directory that you want to work in.&lt;/li&gt;&lt;li&gt;Press Ctrl&lt;u&gt;Shift&lt;/u&gt;B, or click &lt;b&gt;Build Solution&lt;/b&gt; on the &lt;b&gt;Build&lt;/b&gt; menu to compile the sample. &amp;#169; 2008 Microsoft Corporation. All rights reserved.&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description><author>cmslydia</author><pubDate>Fri, 20 Mar 2009 02:49:10 GMT</pubDate><guid isPermaLink="false">Updated Wiki: SS2008!Readme_ServerConnect 20090320024910A</guid></item><item><title>Updated Wiki: SS2008!Readme_Tracer</title><link>http://msftengprodsamples.codeplex.com/Wiki/View.aspx?title=SS2008!Readme_Tracer&amp;version=10</link><description>&lt;div class="wikidoc"&gt;
&lt;h2&gt;
Readme_Tracer Sample
&lt;/h2&gt; &lt;br /&gt; 11/05/2008 21:36:06&lt;br /&gt;  &lt;br /&gt; &lt;br /&gt;This sample demonstrates techniques for implementing profile trace from the local instance of SQL Server to the output console. Using SQL Server Trace Management objects (TMO), this console application can be used to display trace information from the local instance of SQL Server. This sample is not supported on a 64-bit platform.&lt;br /&gt; Samples are provided for educational purposes only. They are not intended to be used in a production environment and have not been tested in a production environment. Microsoft does not provide technical support for these samples. Sample applications and assemblies should not be connected to or used with your production SQL Server database or your report server without the permission of the system administrator. &lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Requirements
&lt;/h3&gt;This sample requires that the following components are installed.&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt; .NET Framework SDK 2.0 or Microsoft Visual Studio 2005. You can obtain .NET Framework SDK free of charge. See &lt;b&gt;Installing the .NET Framework Documentation&lt;/b&gt;.  &lt;/li&gt;&lt;li&gt; Integration Services.  &lt;/li&gt;&lt;li&gt; The sample package and data files that it uses must be installed on the local hard disk drive.   &lt;/li&gt;&lt;li&gt; The &lt;b&gt;AdventureWorks&lt;/b&gt; OLTP database must be installed.  &lt;/li&gt;&lt;li&gt; The &lt;b&gt;AdventureWorks&lt;/b&gt; database must be attached.  &lt;/li&gt;&lt;li&gt; You must have administrative permissions on the &lt;b&gt;AdventureWorks&lt;/b&gt; database.  For more information about how to install samples, see &amp;quot;Installing Sample Integration Services Packages&amp;quot; in SQL Server Books Online.&lt;/li&gt;
&lt;/ul&gt; &lt;br /&gt;&lt;h3&gt;
Location
&lt;/h3&gt;If the code sample was installed to the default location, the sample is located in the following directory:&lt;br /&gt; C:\Program Files\Microsoft SQL Server\100\Samples\Engine\Programmability\SMO\Tracer&lt;br /&gt;The C# solution for the code sample is located in the CS directory, and the Visual Basic solution is located in the VB directory.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Building the Sample
&lt;/h3&gt;If you have not already created a strong name key file, generate the key file using the following instructions.&lt;br /&gt; &lt;br /&gt;&lt;h6&gt;
 To generate a strong name key file
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Open a Microsoft Visual Studio 2005 command prompt. Click &lt;b&gt;Start&lt;/b&gt;, point to &lt;b&gt;All Programs&lt;/b&gt;, point to &lt;b&gt;Microsoft .NET Framework SDK 2.0&lt;/b&gt;, and then click &lt;b&gt;SDK Command Prompt&lt;/b&gt;.-- or --Open a Microsoft .NET Framework command prompt. Click &lt;b&gt;Start&lt;/b&gt;, point to &lt;b&gt;All Programs&lt;/b&gt;, point to &lt;b&gt;Microsoft .NET Framework SDK 2.0&lt;/b&gt;, and then click &lt;b&gt;SDK Command Prompt&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Use the change directory command (CD) to change the current directory of the command prompt window to the folder where the samples are installed. &lt;b&gt;Note: To determine the folder where samples are located, click the &lt;b&gt;Start&lt;/b&gt; button, point to &lt;b&gt;All Programs&lt;/b&gt;, point to &lt;b&gt;Microsoft SQL Server&lt;/b&gt;, point to &lt;b&gt;Documentation and Tutorials&lt;/b&gt;, and then click &lt;b&gt;Samples Directory&lt;/b&gt;. If the default installation location was used, the samples are located in &amp;lt;system_drive&amp;gt;:\Program Files\Microsoft SQL Server\100\Samples.&lt;/b&gt;&lt;/li&gt;&lt;li&gt;At the command prompt, run the following command to generate the key file: &lt;span class="codeInline"&gt;sn -k SampleKey.snk&lt;/span&gt;  &lt;b&gt;Important: For more information about the strong-name key pair, see &amp;quot;Security Briefs: Strong Names and Security in the .NET Framework&amp;quot; in the .NET Development Center on MSDN.&lt;/b&gt;&lt;/li&gt;
&lt;/ol&gt; &lt;br /&gt;&lt;h6&gt;
Building and using the sample using the Command Line Compiler
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Open a .NET Framework or Microsoft Visual Studio 2005 command prompt. Use the change directory (CD) command to change the current directory of the command prompt window to the solution directory that you want to work in.&lt;/li&gt;&lt;li&gt;Type the following command to build either the C# or the Visual Basic version of the sample: &lt;span class="codeInline"&gt;for /r %f in (*.sln) do msbuild.exe &amp;quot;%f&amp;quot;&lt;/span&gt; &lt;/li&gt;
&lt;/ol&gt;&lt;h6&gt;
Building and using the sample from Microsoft Visual Studio 2005 (optional)
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;From the &lt;b&gt;File&lt;/b&gt; menu in Microsoft Visual Studio 2005, click &lt;b&gt;Open&lt;/b&gt;, click &lt;b&gt;Project&lt;/b&gt;, and then open &lt;b&gt;Tracer.sln&lt;/b&gt; in the solution directory that you want to work in.&lt;/li&gt;&lt;li&gt;Press &lt;b&gt;F5&lt;/b&gt;, or click &lt;b&gt;Start&lt;/b&gt; on the &lt;b&gt;Debug&lt;/b&gt; menu to compile and run the project. &amp;#169; 2008 Microsoft Corporation. All rights reserved.&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description><author>cmslydia</author><pubDate>Fri, 20 Mar 2009 02:25:33 GMT</pubDate><guid isPermaLink="false">Updated Wiki: SS2008!Readme_Tracer 20090320022533A</guid></item><item><title>Updated Wiki: SS2008!Readme_LoadRegAssembly</title><link>http://msftengprodsamples.codeplex.com/Wiki/View.aspx?title=SS2008!Readme_LoadRegAssembly&amp;version=10</link><description>&lt;div class="wikidoc"&gt;
&lt;h2&gt;
Readme_LoadRegAssembly Sample
&lt;/h2&gt; &lt;br /&gt; 11/05/2008 21:36:06&lt;br /&gt;  &lt;br /&gt; &lt;br /&gt; This sample works only with SQL Server 2005 and SQL Server 2008. It will not work with any version of SQL Server earlier than SQL Server 2005. &lt;br /&gt;This sample demonstrates techniques for implementing assembly registration capabilities into database applications. By using SQL Server Management Object (SMO) capabilities of Microsoft SQL Server, this application lets users register the assembly and create functions that call the assembly code. This sample provides a user interface that lets the user specify the SQL Server instance to connect to and whether to use Windows Authentication. &lt;br /&gt;Samples are provided for educational purposes only. They are not intended to be used in a production environment and have not been tested in a production environment. Microsoft does not provide technical support for these samples. Sample applications and assemblies should not be connected to or used with your production SQL Server database or your report server without the permission of the system administrator. &lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Requirements
&lt;/h3&gt;This sample requires that the following components are installed.&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt; .NET Framework SDK 2.0 or Microsoft Visual Studio 2005. You can obtain .NET Framework SDK free of charge. See &lt;b&gt;Installing the .NET Framework Documentation&lt;/b&gt;.  &lt;/li&gt;&lt;li&gt; Integration Services.  &lt;/li&gt;&lt;li&gt; The sample package and data files that it uses must be installed on the local hard disk drive.   &lt;/li&gt;&lt;li&gt; The &lt;b&gt;AdventureWorks&lt;/b&gt; OLTP database must be installed.  &lt;/li&gt;&lt;li&gt; The &lt;b&gt;AdventureWorks&lt;/b&gt; database must be attached.   &lt;/li&gt;&lt;li&gt; You must have administrative permissions on the &lt;b&gt;AdventureWorks&lt;/b&gt; database.   For more information about how to install samples, see &amp;quot;Installing Sample Integration Services Packages&amp;quot; in SQL Server Books Online.&lt;/li&gt;
&lt;/ul&gt; &lt;br /&gt;&lt;h3&gt;
Location
&lt;/h3&gt;If the code sample was installed to the default location, the sample is located in the following directory:&lt;br /&gt; C:\Program Files\Microsoft SQL Server\100\Samples\Engine\Programmability\SMO\LoadRegAssembly&lt;br /&gt;The C# solution for the code sample is located in the CS directory, and the Visual Basic solution is located in the VB directory.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Building the Sample
&lt;/h3&gt;If you have not already created a strong name key file, generate the key file using the following instructions.&lt;br /&gt; &lt;br /&gt;&lt;h6&gt;
 To generate a strong name key file
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Open a Microsoft Visual Studio 2005 command prompt. Click &lt;b&gt;Start&lt;/b&gt;, point to &lt;b&gt;All Programs&lt;/b&gt;, point to &lt;b&gt;Microsoft .NET Framework SDK 2.0&lt;/b&gt;, and then click &lt;b&gt;SDK Command Prompt&lt;/b&gt;.-- or --Open a Microsoft .NET Framework command prompt. Click &lt;b&gt;Start&lt;/b&gt;, point to &lt;b&gt;All Programs&lt;/b&gt;, point to &lt;b&gt;Microsoft .NET Framework SDK 2.0&lt;/b&gt;, and then click &lt;b&gt;SDK Command Prompt&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Use the change directory command (CD) to change the current directory of the command prompt window to the folder where the samples are installed. &lt;b&gt;Note: To determine the folder where samples are located, click the &lt;b&gt;Start&lt;/b&gt; button, point to &lt;b&gt;All Programs&lt;/b&gt;, point to &lt;b&gt;Microsoft SQL Server&lt;/b&gt;, point to &lt;b&gt;Documentation and Tutorials&lt;/b&gt;, and then click &lt;b&gt;Samples Directory&lt;/b&gt;. If the default installation location was used, the samples are located in &amp;lt;system_drive&amp;gt;:\Program Files\Microsoft SQL Server\100\Samples.&lt;/b&gt;&lt;/li&gt;&lt;li&gt;At the command prompt, run the following command to generate the key file: &lt;span class="codeInline"&gt;sn -k SampleKey.snk&lt;/span&gt;  &lt;b&gt;Important: For more information about the strong-name key pair, see &amp;quot;Security Briefs: Strong Names and Security in the .NET Framework&amp;quot; in the .NET Development Center on MSDN.&lt;/b&gt;&lt;/li&gt;
&lt;/ol&gt; &lt;br /&gt;&lt;h6&gt;
Building and using the sample using the Command Line Compiler
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Open a .NET Framework or Microsoft Visual Studio 2005 command prompt. Use the change directory (CD) command to change the current directory of the command prompt window to the solution directory that you want to work in.&lt;/li&gt;&lt;li&gt;Type the following command to build either the C# or the Visual Basic version of the sample: &lt;span class="codeInline"&gt;for /r %f in (*.sln) do msbuild.exe &amp;quot;%f&amp;quot;&lt;/span&gt; &lt;/li&gt;
&lt;/ol&gt;&lt;h6&gt;
Building and using the sample from Microsoft Visual Studio 2005 (optional)
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;From the &lt;b&gt;File&lt;/b&gt; menu in Microsoft Visual Studio 2005, click &lt;b&gt;Open&lt;/b&gt;, click &lt;b&gt;Project&lt;/b&gt;, and then open &lt;b&gt;LoadRegAssembly.sln&lt;/b&gt; in the solution directory that you want to work in.&lt;/li&gt;&lt;li&gt;Press &lt;b&gt;F5&lt;/b&gt;, or click &lt;b&gt;Start&lt;/b&gt; on the &lt;b&gt;Debug&lt;/b&gt; menu to compile and run the project. &amp;#169; 2008 Microsoft Corporation. All rights reserved.&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description><author>cmslydia</author><pubDate>Fri, 20 Mar 2009 02:15:56 GMT</pubDate><guid isPermaLink="false">Updated Wiki: SS2008!Readme_LoadRegAssembly 20090320021556A</guid></item><item><title>Updated Wiki: SS2008!Readme_VerifyBackup</title><link>http://msftengprodsamples.codeplex.com/Wiki/View.aspx?title=SS2008!Readme_VerifyBackup&amp;version=10</link><description>&lt;div class="wikidoc"&gt;
&lt;h2&gt;
Readme_VerifyBackup Sample
&lt;/h2&gt; &lt;br /&gt; 11/05/2008 21:36:06&lt;br /&gt;  &lt;br /&gt; &lt;br /&gt; This sample works only with SQL Server 2005 and SQL Server 2008. It will not work with any version of SQL Server earlier than SQL Server 2005. &lt;br /&gt;This sample demonstrates techniques for verifying a backup on a backup device to ensure the data can be used to restore the appropriate databases. By using SQL Server Management Object (SMO) capabilities of Microsoft SQL Server, this application lets users select the backup device and verify the contents of the selected backup. This sample provides a user interface that lets the user specify the SQL Server instance to connect to and whether to use Windows Authentication. The user can then select which database and backup file location and name.&lt;br /&gt; Samples are provided for educational purposes only. They are not intended to be used in a production environment and have not been tested in a production environment. Microsoft does not provide technical support for these samples. Sample applications and assemblies should not be connected to or used with your production SQL Server database or your report server without the permission of the system administrator. &lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Requirements
&lt;/h3&gt;This sample requires that the following components are installed.&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt; .NET Framework SDK 2.0 or Microsoft Visual Studio 2005. You can obtain .NET Framework SDK free of charge. See &lt;b&gt;Installing the .NET Framework Documentation&lt;/b&gt;.  &lt;/li&gt;&lt;li&gt; Integration Services.  &lt;/li&gt;&lt;li&gt; The sample package and data files that it uses must be installed on the local hard disk drive.   &lt;/li&gt;&lt;li&gt; The &lt;b&gt;AdventureWorks&lt;/b&gt; OLTP database must be installed.  &lt;/li&gt;&lt;li&gt; The &lt;b&gt;AdventureWorks&lt;/b&gt; database must be attached.   &lt;/li&gt;&lt;li&gt; You must have administrative permissions on the &lt;b&gt;AdventureWorks&lt;/b&gt; database.   &lt;/li&gt;&lt;li&gt; You must compile the ServerConnect component first, because this sample has a dependency on the ServerConnect sample.   &lt;/li&gt;&lt;li&gt; Run the script &amp;quot;CreateDevicesAndBackups.sql&amp;quot; to create Devices And Backups.   &lt;/li&gt;
&lt;/ul&gt;For more information about how to install samples, see &amp;quot;Installing Sample Integration Services Packages&amp;quot; in SQL Server Books Online.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Location
&lt;/h3&gt;If the code sample was installed to the default location, the sample is located in the following directory:&lt;br /&gt; C:\Program Files\Microsoft SQL Server\100\Samples\Engine\Programmability\SMO\VerifyBackup&lt;br /&gt;The C# solution for the code sample is located in the CS directory, and the Visual Basic solution is located in the VB directory.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Building the Sample
&lt;/h3&gt;If you have not already created a strong name key file, generate the key file using the following instructions.&lt;br /&gt; &lt;br /&gt;&lt;h6&gt;
 To generate a strong name key file
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Open a Microsoft Visual Studio 2005 command prompt. Click &lt;b&gt;Start&lt;/b&gt;, point to &lt;b&gt;All Programs&lt;/b&gt;, point to &lt;b&gt;Microsoft .NET Framework SDK 2.0&lt;/b&gt;, and then click &lt;b&gt;SDK Command Prompt&lt;/b&gt;.-- or --Open a Microsoft .NET Framework command prompt. Click &lt;b&gt;Start&lt;/b&gt;, point to &lt;b&gt;All Programs&lt;/b&gt;, point to &lt;b&gt;Microsoft .NET Framework SDK 2.0&lt;/b&gt;, and then click &lt;b&gt;SDK Command Prompt&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Use the change directory command (CD) to change the current directory of the command prompt window to the folder where the samples are installed. &lt;b&gt;Note: To determine the folder where samples are located, click the &lt;b&gt;Start&lt;/b&gt; button, point to &lt;b&gt;All Programs&lt;/b&gt;, point to &lt;b&gt;Microsoft SQL Server&lt;/b&gt;, point to &lt;b&gt;Documentation and Tutorials&lt;/b&gt;, and then click &lt;b&gt;Samples Directory&lt;/b&gt;. If the default installation location was used, the samples are located in &amp;lt;system_drive&amp;gt;:\Program Files\Microsoft SQL Server\100\Samples.&lt;/b&gt;&lt;/li&gt;&lt;li&gt;At the command prompt, run the following command to generate the key file: &lt;span class="codeInline"&gt;sn -k SampleKey.snk&lt;/span&gt;  &lt;b&gt;Important: For more information about the strong-name key pair, see &amp;quot;Security Briefs: Strong Names and Security in the .NET Framework&amp;quot; in the .NET Development Center on MSDN.&lt;/b&gt;&lt;/li&gt;
&lt;/ol&gt; &lt;br /&gt;&lt;h6&gt;
Building and using the sample using the Command Line Compiler
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Open a .NET Framework or Microsoft Visual Studio 2005 command prompt. Use the change directory (CD) command to change the current directory of the command prompt window to the solution directory that you want to work in.&lt;/li&gt;&lt;li&gt;Type the following command to build either the C# or the Visual Basic version of the sample: &lt;span class="codeInline"&gt;for /r %f in (*.sln) do msbuild.exe &amp;quot;%f&amp;quot;&lt;/span&gt; &lt;/li&gt;
&lt;/ol&gt;&lt;h6&gt;
Building and using the sample from Microsoft Visual Studio 2005 (optional)
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;From the &lt;b&gt;File&lt;/b&gt; menu in Microsoft Visual Studio 2005, click &lt;b&gt;Open&lt;/b&gt;, click &lt;b&gt;Project&lt;/b&gt;, and then open &lt;b&gt;VerifyBackup.sln&lt;/b&gt; in the solution directory that you want to work in.&lt;/li&gt;&lt;li&gt;Press &lt;b&gt;F5&lt;/b&gt;, or click &lt;b&gt;Start&lt;/b&gt; on the &lt;b&gt;Debug&lt;/b&gt; menu to compile and run the project. &amp;#169; 2008 Microsoft Corporation. All rights reserved.&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description><author>libinzhao</author><pubDate>Thu, 19 Mar 2009 10:01:45 GMT</pubDate><guid isPermaLink="false">Updated Wiki: SS2008!Readme_VerifyBackup 20090319100145A</guid></item><item><title>Updated Wiki: SS2008!Readme_BackRest</title><link>http://msftengprodsamples.codeplex.com/Wiki/View.aspx?title=SS2008!Readme_BackRest&amp;version=11</link><description>&lt;div class="wikidoc"&gt;
&lt;h2&gt;
Readme_BackRest Sample
&lt;/h2&gt; &lt;br /&gt; 11/05/2008 21:36:06&lt;br /&gt;  &lt;br /&gt; &lt;br /&gt; This sample works only with SQL Server 2005 and SQL Server 2008. It will not work with any version of SQL Server earlier than SQL Server 2005. &lt;br /&gt;This sample demonstrates techniques for implementing backup and restore capabilities in database applications. By using SQL Server Management Object (SMO) capabilities of Microsoft SQL Server, this application lets users backup and restore the selected database to a specific file on a user's hard disk drive. This sample provides a user interface that permits specifying the SQL Server instance to connect to and whether to use Windows Authentication. The user can then select the appropriate database and backup file location and name.&lt;br /&gt; Samples are provided for educational purposes only. They are not intended to be used in a production environment and have not been tested in a production environment. Microsoft does not provide technical support for these samples. Sample applications and assemblies should not be connected to or used with your production SQL Server database or your report server without the permission of the system administrator. &lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Requirements
&lt;/h3&gt;This sample requires that the following components are installed.&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt; .NET Framework SDK 2.0 or Microsoft Visual Studio 2005. You can obtain .NET Framework SDK free of charge. See &lt;b&gt;Installing the .NET Framework Documentation&lt;/b&gt;.  &lt;/li&gt;&lt;li&gt; The sample package and data files that it uses must be installed on the local hard disk drive.   &lt;/li&gt;&lt;li&gt; The &lt;b&gt;AdventureWorks&lt;/b&gt; OLTP database must be installed.  &lt;/li&gt;&lt;li&gt; The &lt;b&gt;AdventureWorks&lt;/b&gt; database must be attached.  &lt;/li&gt;&lt;li&gt; You must have administrative permissions on the &lt;b&gt;AdventureWorks&lt;/b&gt; database.   &lt;/li&gt;&lt;li&gt; You must compile the ServerConnect component first, because this sample has a dependency on the ServerConnect sample.   For more information about how to install samples, see &amp;quot;Installing Sample Integration Services Packages&amp;quot; in SQL Server Books Online.&lt;/li&gt;
&lt;/ul&gt; &lt;br /&gt;&lt;h3&gt;
Location
&lt;/h3&gt;If the code sample was installed to the default location, the sample is located in the following directory:&lt;br /&gt; C:\Program Files\Microsoft SQL Server\100\Samples\Engine\Programmability\SMO\BackRest&lt;br /&gt;The C# solution for the code sample is located in the CS directory, and the Visual Basic solution is located in the VB directory.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Building the Sample
&lt;/h3&gt;If you have not already created a strong name key file, generate the key file using the following instructions.&lt;br /&gt; &lt;br /&gt;&lt;h6&gt;
 To generate a strong name key file
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Open a Microsoft Visual Studio 2005 command prompt. Click &lt;b&gt;Start&lt;/b&gt;, point to &lt;b&gt;All Programs&lt;/b&gt;, point to &lt;b&gt;Microsoft .NET Framework SDK 2.0&lt;/b&gt;, and then click &lt;b&gt;SDK Command Prompt&lt;/b&gt;.-- or --Open a Microsoft .NET Framework command prompt. Click &lt;b&gt;Start&lt;/b&gt;, point to &lt;b&gt;All Programs&lt;/b&gt;, point to &lt;b&gt;Microsoft .NET Framework SDK 2.0&lt;/b&gt;, and then click &lt;b&gt;SDK Command Prompt&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Use the change directory command (CD) to change the current directory of the command prompt window to the folder where the samples are installed. &lt;b&gt;Note: To determine the folder where samples are located, click the &lt;b&gt;Start&lt;/b&gt; button, point to &lt;b&gt;All Programs&lt;/b&gt;, point to &lt;b&gt;Microsoft SQL Server&lt;/b&gt;, point to &lt;b&gt;Documentation and Tutorials&lt;/b&gt;, and then click &lt;b&gt;Samples Directory&lt;/b&gt;. If the default installation location was used, the samples are located in &amp;lt;system_drive&amp;gt;:\Program Files\Microsoft SQL Server\100\Samples.&lt;/b&gt;&lt;/li&gt;&lt;li&gt;At the command prompt, run the following command to generate the key file: &lt;span class="codeInline"&gt;sn -k SampleKey.snk&lt;/span&gt;  &lt;b&gt;Important: For more information about the strong-name key pair, see &amp;quot;Security Briefs: Strong Names and Security in the .NET Framework&amp;quot; in the .NET Development Center on MSDN.&lt;/b&gt;&lt;/li&gt;
&lt;/ol&gt; &lt;br /&gt;&lt;h6&gt;
Building and using the sample using the Command Line Compiler
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Open a .NET Framework or Microsoft Visual Studio 2005 command prompt. Use the change directory (CD) command to change the current directory of the command prompt window to the solution directory that you want to work in.&lt;/li&gt;&lt;li&gt;Type the following command to build either the C# or the Visual Basic version of the sample: &lt;span class="codeInline"&gt;for /r %f in (*.sln) do msbuild.exe &amp;quot;%f&amp;quot;&lt;/span&gt; &lt;/li&gt;
&lt;/ol&gt;&lt;h6&gt;
Building and using the sample from Microsoft Visual Studio 2005 (optional)
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;From the &lt;b&gt;File&lt;/b&gt; menu, click &lt;b&gt;Open&lt;/b&gt;, click &lt;b&gt;Project&lt;/b&gt;, and then open &lt;b&gt;BackRest.sln&lt;/b&gt; in the desired solution directory.&lt;/li&gt;&lt;li&gt;Press &lt;b&gt;F5&lt;/b&gt;, or click &lt;b&gt;Start&lt;/b&gt; on the &lt;b&gt;Debug&lt;/b&gt; menu to compile and run the project. &amp;#169; 2008 Microsoft Corporation. All rights reserved.&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description><author>libinzhao</author><pubDate>Thu, 19 Mar 2009 09:43:12 GMT</pubDate><guid isPermaLink="false">Updated Wiki: SS2008!Readme_BackRest 20090319094312A</guid></item><item><title>Updated Wiki: SS2008!Grouping Sets Report</title><link>http://msftengprodsamples.codeplex.com/Wiki/View.aspx?title=SS2008!Grouping Sets Report&amp;version=3</link><description>&lt;div class="wikidoc"&gt;
&lt;h2&gt;
Readme_Grouping Sets Report Sample
&lt;/h2&gt; &lt;br /&gt; 11/05/2008 21:36:06&lt;br /&gt;  &lt;br /&gt; &lt;br /&gt; This sample works only with SQL Server 2005 and SQL Server 2008. It will not work with any version of SQL Server earlier than SQL Server 2005. &lt;br /&gt;This sample illustrates how to combine the SQL Server 2008 GROUPING SETS feature of Transact-SQL with the new Tablix capabilities of SQL Server 2008 Reporting Services to display the output of a GROUPING SETS query in a pivot-table-style format.&lt;br /&gt;The GROUPING SETS feature allows you to write a single query which groups by multiple different sets of grouping columns, with complete control over what columns to group by. This can make the query easier to write and allow it to run faster than in prior SQL Server releases. Of course, it is desirable to render the output of a query in an appealing report format, and SQL Server Reporting Services is the tool of choice for that. &lt;br /&gt;For more information, see &lt;a href="http://go.microsoft.com/fwlink/?LinkId=122650" class="externalLink"&gt;Using GROUP BY with ROLLUP, CUBE, and GROUPING SETS&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; in SQL Server 2008 Books Online.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Scenario
&lt;/h3&gt;The goal of this sample is to produce a pivot-table-style report that looks like this:&lt;br /&gt;The report shows the number of distinct products sold per country for each quarter. It also shows the total number of distinct products sold for all countries for each quarter, as well as the total number of distinct products per country for six quarters. The distinct counts are based on results from the following query.&lt;br /&gt; &lt;br /&gt;&lt;table&gt;
&lt;tr&gt;
&lt;th&gt;  &lt;/th&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;td&gt; {&amp;quot; USE AdventureWorksDW2008;GOSELECT D.CalendarYear, D.CalendarQuarter, T.SalesTerritoryCountry,     COUNT(DISTINCT F.ProductKey) AS DistinctProductCountFROM dbo.FactResellerSales F    INNER JOIN dbo.DimDate D ON F.OrderDateKey = D.DateKey    INNER JOIN dbo.DimSalesTerritory T ON     F.SalesTerritoryKey = T.SalesTerritoryKey WHERE D.CalendarYear IN ('2003', '2004')  GROUP BY GROUPING SETS (    (D.CalendarYear, D.CalendarQuarter, T.SalesTerritoryCountry),    (D.CalendarYear, D.CalendarQuarter),    (T.SalesTerritoryCountry),());GO &amp;quot;} &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt; &lt;br /&gt;The approach used in this sample is best for non-additive aggregates like  &lt;span class="codeInline"&gt;COUNT(DISTINCT…)&lt;/span&gt; ,  &lt;span class="codeInline"&gt;STDEV&lt;/span&gt; , and  &lt;span class="codeInline"&gt;AVG, &lt;/span&gt; whose aggregate results do not support commutative and associative properties. For example, given the set (1, 1, 2, 2), COUNT ( DISTINCT (1, 1) ) + COUNT ( DISTINCT (2, 2) ) = 2, but COUNT ( DISTINCT (1, 2) ) + COUNT ( DISTINCT ( 1, 2 ) ) = 4.&lt;br /&gt;If you are using a grouping query that uses an additive aggregate (e.g.  &lt;span class="codeInline"&gt;COUNT&lt;/span&gt; ,  &lt;span class="codeInline"&gt;SUM&lt;/span&gt; ,  &lt;span class="codeInline"&gt;MIN&lt;/span&gt; , or  &lt;span class="codeInline"&gt;MAX&lt;/span&gt; ), you can use a query similar to the one below, which uses COUNT without grouping sets, and use the Tablix control in SQL Server 2008 Reporting Services to produce row and column aggregates and an overall aggregate. &lt;br /&gt; &lt;br /&gt;&lt;table&gt;
&lt;tr&gt;
&lt;th&gt;  &lt;/th&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;td&gt; {&amp;quot; USE AdventureWorksDW2008;GOSELECT D.CalendarYear, D.CalendarQuarter, T.SalesTerritoryCountry,     COUNT(F.SalesAmount) as SalesAmountFROM dbo.FactResellerSales F    INNER JOIN dbo.DimDate D ON F.OrderDateKey = D.DateKey    INNER JOIN dbo.DimSalesTerritory T ON    F.SalesTerritoryKey = T.SalesTerritoryKeyWHERE D.CalendarYear IN ('2003', '2004')GROUP BY D.CalendarYear, D.CalendarQuarter, T.SalesTerritoryCountry;GO &amp;quot;} &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt; &lt;br /&gt;It is easiest to compute aggregates for (Year,Quarter), (Country) and () groupings inside Reporting Services in this situation, rather than modify the query to use GROUPING SETS.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Languages
&lt;/h3&gt; Transact-SQL &lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Prerequisites
&lt;/h3&gt;Before you run this sample, install the following software.&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt; SQL Server 2008 and the following components:  &lt;/li&gt;&lt;li&gt; Database Engine   &lt;/li&gt;&lt;li&gt; Reporting Services   &lt;/li&gt;&lt;li&gt; Business Intelligence Development Tools  &lt;/li&gt;&lt;li&gt; Visual Studio   &lt;/li&gt;&lt;li&gt; samples for SQL Server 2008. The default installation directory is C:\Program Files\Microsoft SQL Server\100\Samples\Engine\Query Processing\Grouping Sets Report.  &lt;/li&gt;&lt;li&gt; AdventureWorksDW2008 sample database for SQL Server 2008. You can obtain this from the &lt;a href="http://go.microsoft.com/fwlink/?LinkID=67739" class="externalLink"&gt;SQL Server Samples site on Codeplex&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; Web site. For example, if you are using the x64 architecture, you can download SQL2008.AdventureWorks&lt;i&gt;DW&lt;/i&gt;BI_v2008.x64.msi to install AdventureWorksDW2008. For more information, see &lt;a href="http://go.microsoft.com/fwlink/?LinkId=122649" class="externalLink"&gt;Considerations for Installing SQL Server Samples and Sample Databases&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; in SQL Server 2008 Books Online.  &lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;
Running the Sample
&lt;/h3&gt;The following steps show how to run the Grouping Sets Matrix Sample.rdl script to see the report based on the AdventureWorksDW 2008 sample database.&lt;br /&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt; From the Start menu, open My Computer and navigate to the installation directory, C:\Program Files\Microsoft SQL Server\100\Samples\Engine\Query Processing\Grouping Sets Report.  &lt;/li&gt;&lt;li&gt; Double-click &amp;quot;Grouping Sets Report Project.sln&amp;quot; to open the project in Visual Studio.  &lt;/li&gt;&lt;li&gt; Expand Shared Data Sources, double-click AdventureWorksDW1.rds and adjust the settings in the dialog box so that you can connect to your AdventureWorksDW 2008 database.  &lt;/li&gt;&lt;li&gt; In Solution Explorer, expand the Reports folder, and double-click Grouping Sets Matrix Sample.rdl.  &lt;/li&gt;&lt;li&gt; Click the preview tab to see the report.   Note the following interesting things about the sample:   A new column group and row group have been added outside the default groups. These are named STCountry2 and CY2.   &lt;/li&gt;
&lt;/ol&gt;  If you right-click these in the above location, click &lt;b&gt;Edit Group,&lt;/b&gt; and then edit the filters for the groups, you will see that source query rows with NULL grouping keys are filtered in different ways to produce the column, row, and overall distinct counts.  &lt;br /&gt;&lt;h3&gt;
Summary
&lt;/h3&gt;This sample showed how to create a pivot table report over a GROUPING SETS query using SQL Server 2008 Reporting Services (SSRS). Use this approach for non-additive aggregates such as COUNT(DISTINCT…), AVG, and STDEV. For additive aggregates such as SUM and COUNT, compute the row, column, and grand totals in Reporting Services instead, and do not use GROUPING SETS in your Transact-SQL query.&lt;br /&gt; &amp;#169; 2008 Microsoft Corporation. All rights reserved.&lt;br /&gt;
&lt;/div&gt;</description><author>cmslydia</author><pubDate>Thu, 19 Mar 2009 06:52:58 GMT</pubDate><guid isPermaLink="false">Updated Wiki: SS2008!Grouping Sets Report 20090319065258A</guid></item><item><title>Updated Wiki: SS2008!Supplementary-Aware String Manipulation</title><link>http://msftengprodsamples.codeplex.com/Wiki/View.aspx?title=SS2008!Supplementary-Aware String Manipulation&amp;version=9</link><description>&lt;div class="wikidoc"&gt;
&lt;h2&gt;
Readme_Supplementary-Aware String Manipulation Sample
&lt;/h2&gt; &lt;br /&gt; 11/05/2008 21:36:06&lt;br /&gt;  &lt;br /&gt; &lt;br /&gt; This sample works only with SQL Server 2005 and SQL Server 2008. It will not work with any version of SQL Server earlier than SQL Server 2005. &lt;br /&gt;The StringManipulate sample for Microsoft SQL Server demonstrates supplementary character aware string processing. This sample shows the implementation of five Transact-SQL string functions that provide the same string manipulation functions as the built-in functions, but with additional supplementary character-aware capability to handle both Unicode and supplementary character strings. The five functions are len&lt;i&gt;s(), left&lt;/i&gt;s(), right&lt;i&gt;s(), sub&lt;/i&gt;s() and replace_s() which are equivalent to the built-in functions LEN(), LEFT(), RIGHT(), SUBSTRING() and REPLACE() string functions. &lt;br /&gt; &lt;br /&gt;&lt;table&gt;
&lt;tr&gt;
&lt;th&gt; Note:  &lt;/th&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;td&gt;  When compiling common language runtime (CLR) integration samples, the path of the version of the Microsoft .NET Framework compiler that was included with SQL Server must be the first Framework directory in the PATH environment variable. The location of the compiler that was included with SQL Server is either &lt;i&gt;drive&lt;/i&gt;:\WINNT\Microsoft.NET\Framework\v2.0.&lt;i&gt;xxxxx&lt;/i&gt; or _ drive&lt;i&gt;:\Windows\Microsoft.NET\Framework\v2.0.&lt;/i&gt;xxxxx_, where _ drive_ is the installation drive and &lt;i&gt;xxxxx&lt;/i&gt; is the version of the .NET Framework that was included with SQL Server. &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt; &lt;br /&gt; &lt;br /&gt;Default Location:__C:\Program Files\Microsoft SQL Server\100\Samples\Engine\Programmability\CLR\StringManipulate&lt;br /&gt; SQL Server samples and sample databases must be downloaded and installed before you can view or work with them. For more information, see &lt;i&gt;Considerations for Installing SQL Server Samples and Sample Databases&lt;/i&gt;.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Scenario
&lt;/h3&gt;A developer wants to accurately manipulate Unicode strings that contain supplementary characters.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Languages
&lt;/h3&gt; Transact-SQL, Visual C# and Visual Basic.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Features
&lt;/h3&gt;The StringManipulate sample uses the following features of Microsoft SQL Server.&lt;br /&gt; &lt;br /&gt;&lt;table&gt;
&lt;tr&gt;
&lt;th&gt;  Application Area &lt;/th&gt;&lt;th&gt;  Features  &lt;/th&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;td&gt; Overall &lt;/td&gt;&lt;td&gt; CLR user-defined function &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt; &lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Prerequisites
&lt;/h3&gt;Before running this sample, make sure the following software is installed:&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt; Microsoft SQL Server or Microsoft SQL Server Express. You can obtain SQL Server Express free of charge from the SQL Server Express Documentation and Samples &lt;a href="http://go.microsoft.com/fwlink/?LinkId=31046" class="externalLink"&gt;Web site&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;  &lt;/li&gt;&lt;li&gt; The &lt;b&gt;AdventureWorks&lt;/b&gt; database that is available at the SQL Server Developer &lt;a href="http://go.microsoft.com/fwlink/?linkid=62796" class="externalLink"&gt;Web site&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.  &lt;/li&gt;&lt;li&gt; The SQL Server Database Engine samples that are available at the SQL Server Developer &lt;a href="http://go.microsoft.com/fwlink/?linkid=62796" class="externalLink"&gt;Web site&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.  &lt;/li&gt;&lt;li&gt; .NET Framework SDK 2.0 or Microsoft Visual Studio 2005. You can obtain .NET Framework SDK free of charge. See &lt;b&gt;Installing the .NET Framework Documentation&lt;/b&gt;.  &lt;/li&gt;&lt;li&gt; Ext-B font must be installed on the computer for the correct characters to appear in the SQL Server Management Studio results window. To change the font in the results window, in Management Studio, on the &lt;b&gt;Tools&lt;/b&gt; menu, click &lt;b&gt;Options&lt;/b&gt;, expand &lt;b&gt;Environment&lt;/b&gt;, and then click &lt;b&gt;Fonts and Colors&lt;/b&gt;. Set the font to MingLiU_ExtB for Text Results and/or Grid Results. You must close and then reopen Management Studio for the changes to take effect.  &lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;
Building the Sample
&lt;/h3&gt;If you have not already created the strong-name key file &lt;b&gt;ExternalSampleKey.snk&lt;/b&gt;, generate the key file using the following instructions. &lt;br /&gt; &lt;br /&gt;&lt;h6&gt;
To generate a strong name key file
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Open a Microsoft Visual Studio 2005 command prompt. Click &lt;b&gt;Start&lt;/b&gt;, point to &lt;b&gt;All Programs&lt;/b&gt;, point to &lt;b&gt;Microsoft Visual Studio 2005&lt;/b&gt;, point to &lt;b&gt;Visual Studio Tools&lt;/b&gt;, and then click &lt;b&gt;Visual Studio 2005 Command Prompt&lt;/b&gt;.—Or—Open a Microsoft .NET Framework command prompt. Click &lt;b&gt;Start&lt;/b&gt;, point to &lt;b&gt;All Programs&lt;/b&gt;, point to &lt;b&gt;Microsoft .NET Framework SDK 2.0&lt;/b&gt;, and then click &lt;b&gt;SDK Command Prompt&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;At the command prompt, use the change directory (CD) command to change the current folder of the command prompt window to the Samples folder.  &lt;b&gt;Note:   To determine the folder where samples are located, click &lt;b&gt;Start&lt;/b&gt;, point to &lt;b&gt;All Programs&lt;/b&gt;, point to &lt;b&gt;Microsoft SQL Server&lt;/b&gt;, point to &lt;b&gt;Documentation and Tutorials&lt;/b&gt;, and then click &lt;b&gt;Samples Directory&lt;/b&gt;. If the default installation location was used, the samples are located in &amp;lt;&lt;i&gt;system&lt;/i&gt;drive_&amp;gt;:\Program Files\Microsoft SQL Server\100\Samples.&lt;/b&gt;&lt;/li&gt;&lt;li&gt;At the command prompt, run the following command to generate the key file: &lt;span class="codeInline"&gt;sn -k ExternalSampleKey.snk&lt;/span&gt; ** &lt;b&gt;Important:   For more information about the strong-name key pair, see &amp;quot;Security Briefs: Strong Names and Security in the .NET Framework&amp;quot; in the .NET Development Center on MSDN.&lt;/b&gt;To build the sample, do the following:&lt;/li&gt;
&lt;/ol&gt; &lt;br /&gt;&lt;h6&gt;
Build the sample
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Compile the sample by using Visual Studio 2005 and the provided Visual Studio solution, or by using Microsoft MSBuild, which is included in the .NET Framework SDK 2.0. Run a command similar to the following at the command prompt: &lt;span class="codeInline"&gt;msbuild /nologo /verbosity:quiet /property:Configuration=Debug CS\StringManipulate.sln&lt;/span&gt; &lt;/li&gt;&lt;li&gt;Make sure that the &lt;b&gt;AdventureWorks&lt;/b&gt; database is installed, or, if necessary, create the database in which you want to install the samples.&lt;/li&gt;&lt;li&gt;If you did not install the SQL Server Database Engine samples in the default location, modify the path in the CREATE ASSEMBLY part of the script in Scripts\InstallCS.sql and Scripts\InstallVB.sql to refer to location where the samples were installed.&lt;/li&gt;&lt;li&gt;Open the scripts\installCS.sql or scripts\installVB.sql file, depending on whether you compiled the Visual C# project or the Visual Basic project, in Management Studio. Run the script that is contained in the file, or run a command similar to the following at the command prompt: &lt;span class="codeInline"&gt; sqlcmd -E -I -i Scripts\InstallCS.sql&lt;/span&gt; This file contains script to install and register the sample CLR objects into SQL Server.&lt;/li&gt;
&lt;/ol&gt;&lt;h3&gt;
Running the Sample
&lt;/h3&gt;To run the sample, do the following:&lt;br /&gt; &lt;br /&gt;&lt;h6&gt;
Run the sample
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Open the scripts\test.sql file in SQL Server Management Studio. Run the script that is contained in the file, or run the following at the command prompt: &lt;span class="codeInline"&gt; sqlcmd -E -I -i Scripts\test.sql&lt;/span&gt; This script invokes the string manipulation sample from Transact-SQL.&lt;/li&gt;
&lt;/ol&gt;&lt;h3&gt;
Removing the Sample
&lt;/h3&gt;To remove the StringManipulate sample, do the following:&lt;br /&gt; &lt;br /&gt;&lt;h6&gt;
Remove the sample
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Open the scripts\cleanup.sql file in SQL Server Management Studio. Run the script that is contained in the file, or run the following at the command prompt: &lt;span class="codeInline"&gt;sqlcmd -E -I -i Scripts\cleanup.sql&lt;/span&gt; This script removes the sample.&lt;/li&gt;
&lt;/ol&gt;&lt;h3&gt;
Comments
&lt;/h3&gt; The CLR for SQL Server 2008 or SQL Server Express must be enabled for this sample to work correctly. &lt;br /&gt; Samples are provided for educational purposes only. They are not intended to be used in a production environment and have not been tested in a production environment. Microsoft does not provide technical support for these samples. Sample applications and assemblies should not be connected to or used with your production SQL Server database or your report server without the permission of the system administrator. &lt;br /&gt; &amp;#169; 2008 Microsoft Corporation. All rights reserved.&lt;br /&gt;
&lt;/div&gt;</description><author>leilu</author><pubDate>Thu, 19 Mar 2009 05:54:54 GMT</pubDate><guid isPermaLink="false">Updated Wiki: SS2008!Supplementary-Aware String Manipulation 20090319055454A</guid></item><item><title>Updated Wiki: SS2008!Data Warehouse Tuning Techniques Sample</title><link>http://msftengprodsamples.codeplex.com/Wiki/View.aspx?title=SS2008!Data Warehouse Tuning Techniques Sample&amp;version=3</link><description>&lt;div class="wikidoc"&gt;
&lt;h2&gt;
Readme_Data Warehouse Tuning Techniques Sample
&lt;/h2&gt; &lt;br /&gt; 11/05/2008 21:36:06&lt;br /&gt;  &lt;br /&gt; &lt;br /&gt; This sample works only with SQL Server 2005 and SQL Server 2008. It will not work with any version of SQL Server earlier than SQL Server 2005. &lt;br /&gt;This sample demonstrates techniques for tuning data warehouse queries to improve query performance. In most cases, the query optimizer creates high-quality query plans. However, for specific query patterns, you can improve the query plan by manually tuning the query. Here, we present three such scenarios and their tuning techniques.&lt;br /&gt;The run times cited below were recorded by using an AMD Athlon 64 X2 Dual-Core 4200 CPU with 4 GB of RAM, running Windows Server 2008 and SQL Server 2008. The queries were run from SQL Server Management Studio.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Languages
&lt;/h3&gt; Transact-SQL &lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Prerequisites
&lt;/h3&gt;Before you run this sample, install the following software.&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt; SQL Server 2008 and the following components:  &lt;/li&gt;&lt;li&gt; The Database Engine  &lt;/li&gt;&lt;li&gt; SQL Server Management Studio   &lt;/li&gt;&lt;li&gt; Database Engine samples for SQL Server 2008. The default installation directory is C:\Program Files\Microsoft SQL Server\100\Samples\Engine\Query Processing\Data Warehouse Tuning Techniques.  &lt;/li&gt;&lt;li&gt; AdventureWorksDW2008  sample database for SQL Server 2008. For example, if you are using the x64 architecture, you can download SQL2008.AdventureWorks&lt;i&gt;DW&lt;/i&gt;BI_v2008.x64.msi to install  AdventureWorksDW2008 . For more information about installing the samples, see &lt;a href="http://go.microsoft.com/fwlink/?LinkId=122649" class="externalLink"&gt;Considerations for Installing SQL Server Samples and Sample Databases&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; in SQL Server 2008 Books Online.  &lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;
Running the Sample
&lt;/h3&gt; &lt;br /&gt;&lt;h5&gt;
Prepare the Database
&lt;/h5&gt;The examples included with the Data Warehouse Tuning sample are designed to operate on a modified version of  AdventureWorksDW2008 . The original sample database has small fact tables in comparison to data warehousing sizes. Execute the following step one time to create the new  FactInternetSalesBig  fact table. This is approximately 1000 times larger than  FactInternetSales . &lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt; Run Prepare.sql. Note that, depending on your machine performance, this might take around one hour or more (run time on test machine was 54 minutes). Note that the extended database will need around 25 GB of drive space.  &lt;/li&gt;
&lt;/ul&gt;&lt;h5&gt;
Example 1: Tune Join Into Semi-Join
&lt;/h5&gt;This example tunes a query by converting the original join into an explicit semi-join using an EXISTS subquery. Note that the DatesRange common expression returns a single row and uses the fact table only to check whether sales exist for specific dates. A join is not needed to achieve the correct query results; a semi-join is sufficient. However, the query optimizer does not replace this join with a semi-join because the replacement does not apply in all scenarios. Some aggregates (for example, SUM) allow the replacement and some aggregates (for example, COUNT) do not.&lt;br /&gt;Using EXISTS will avoid the expensive inner join, so that for each date row, only the existence of a single fact row will be checked. To demonstrate this, follow these steps:&lt;br /&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt; Open SemiJoin.sql in SQL Server Management Studio.  &lt;/li&gt;&lt;li&gt; Execute Original Query. Notice the time it takes to execute the query. On the test machine, the query took 2 minutes, 8 seconds.  &lt;/li&gt;&lt;li&gt; Execute Tuned Query. Notice the time it takes to execute the query. The execution time should be significantly less than that of the original query. On the test machine, the query took 1 minute, 1 second.  &lt;/li&gt;
&lt;/ol&gt;&lt;h5&gt;
Example 2: Split Distinct Aggregates
&lt;/h5&gt;The Original Query of this sample generates a query plan with a multi-consumer spool, shared by the aggregate function and by the distinct operator. A spool is expensive and can be avoided by breaking up the query into a plan with two SELECT statements. This results in serial GROUP BY operators and avoids the spool and join. To demonstrate this, follow these steps:&lt;br /&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt; Open CountDistinct.sql in SQL Server Management Studio.  &lt;/li&gt;&lt;li&gt; Execute Original Query. Notice the time it takes to execute the query. On the test machine, the query took 3 minutes, 5 seconds.  &lt;/li&gt;&lt;li&gt; Execute Tuned Query. Notice the time it takes to execute the query. The execution time should be significantly less than that of the original query. On the test machine, the query took 1 minute, 18 seconds.  &lt;/li&gt;
&lt;/ol&gt;&lt;h5&gt;
Example 3: Reuse Common Expressions
&lt;/h5&gt;The original query of this sample generates a query plan with equivalent sub-branches due to the reuse of common expressions. To avoid such duplicate plan branches, a temporary table can be used to store the intermediate result of the common expression. To demonstrate this, follow these steps:&lt;br /&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt; Open CommonExpression.sql in SQL Server Management Studio.  &lt;/li&gt;&lt;li&gt; Execute Original Query. Notice the time it takes to execute the query. On the test machine, the query took 2 minutes, 10 seconds.  &lt;/li&gt;&lt;li&gt; Execute Tuned Query. Notice the time it takes to execute the query. The execution time should be significantly less than the original query. On the test machine, the query took 1 minute, 18 seconds.   &amp;#169; 2008 Microsoft Corporation. All rights reserved.&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description><author>cmslydia</author><pubDate>Thu, 19 Mar 2009 05:53:38 GMT</pubDate><guid isPermaLink="false">Updated Wiki: SS2008!Data Warehouse Tuning Techniques Sample 20090319055338A</guid></item></channel></rss>