<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Microsoft SQL Server Support Blog</title><link>http://blogs.msdn.com/b/sqlblog/</link><description>SQL Server information from the folks at Microsoft Support</description><dc:language>en</dc:language><generator>Telligent Community 5.6.583.20496 (Build: 5.6.583.20496)</generator><item><title>Use Microsoft Linux ODBC Driver and Linked Server to access OLEDB Data sources on Remote Systems</title><link>http://blogs.msdn.com/b/sqlblog/archive/2012/02/08/use-microsoft-linux-odbc-driver-and-linked-server-to-access-oledb-data-sources-on-remote-systems.aspx</link><pubDate>Wed, 08 Feb 2012 19:34:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10265572</guid><dc:creator>sqlblog</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/sqlblog/rsscomments.aspx?WeblogPostID=10265572</wfw:commentRss><comments>http://blogs.msdn.com/b/sqlblog/archive/2012/02/08/use-microsoft-linux-odbc-driver-and-linked-server-to-access-oledb-data-sources-on-remote-systems.aspx#comments</comments><description>&lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="mso-ansi-language: en" lang="EN"&gt;&lt;font size="3"&gt;&lt;font color="#000000"&gt;&lt;font face="Calibri"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="mso-ansi-language: en" lang="EN"&gt;&lt;font size="3"&gt;&lt;font color="#000000"&gt;&lt;font face="Calibri"&gt;By Gregory Suarez | Sr. Escalation Engineer | SQL Server&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="mso-ansi-language: en" lang="EN"&gt;&lt;font size="3"&gt;&lt;font color="#000000"&gt;&lt;font face="Calibri"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;span style="mso-ansi-language: en" lang="EN"&gt;   &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="mso-ansi-language: en" lang="EN"&gt;&lt;font size="3"&gt;&lt;font color="#000000"&gt;&lt;font face="Calibri"&gt;I was recently working with one of our customers when he indicated it would be great if the Microsoft Linux ODBC driver could be used to access his other database systems - in addition to Microsoft SQL Server. &lt;span style="mso-spacerun: yes"&gt;&amp;#160;&lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&lt;/span&gt;Apparently, he liked the driver so much; the idea of having a single database client stack could simplify administration, reduce the memory footprint of his client application and further increase performance and throughput. &lt;span style="mso-spacerun: yes"&gt;&amp;#160;&lt;/span&gt; &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="mso-ansi-language: en" lang="EN"&gt;&lt;font size="3"&gt;&lt;font color="#000000"&gt;&lt;font face="Calibri"&gt;At the time, I didn’t think much of this – but shortly after his comment, I realized this is something that’s easily accomplished. &lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;After all, the driver is similar to what we currently have running on the Windows platform. &lt;span style="mso-spacerun: yes"&gt;&amp;#160;&lt;/span&gt;As long as an appropriate OLEDB provider is configured as a linked server within SQL Server everything should be good to go. &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0in 0in 10pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto" class="MsoNormal"&gt;&lt;span style="color: black; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-bidi-font-family: calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;A linked server configuration enables SQL Server to execute commands against OLE DB data sources on remote servers. Linked servers offer the following advantages: &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="text-indent: -0.25in; margin: 0in 0in 10pt 30pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l1 level1 lfo1; tab-stops: list .5in" class="MsoNormal"&gt;&lt;span style="font-family: symbol; color: black; font-size: 10pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: symbol; mso-bidi-font-family: symbol"&gt;&lt;span style="mso-list: ignore"&gt;·&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-bidi-font-family: calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;Remote server access. &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="text-indent: -0.25in; margin: 0in 0in 10pt 30pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l1 level1 lfo1; tab-stops: list .5in" class="MsoNormal"&gt;&lt;span style="font-family: symbol; color: black; font-size: 10pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: symbol; mso-bidi-font-family: symbol"&gt;&lt;span style="mso-list: ignore"&gt;·&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-bidi-font-family: calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;The ability to issue distributed queries, updates, commands, and transactions on heterogeneous data sources across the enterprise. &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="text-indent: -0.25in; margin: 0in 0in 10pt 30pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l1 level1 lfo1; tab-stops: list .5in" class="MsoNormal"&gt;&lt;span style="font-family: symbol; color: black; font-size: 10pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: symbol; mso-bidi-font-family: symbol"&gt;&lt;span style="mso-list: ignore"&gt;·&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-bidi-font-family: calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;The ability to address diverse data sources similarly. &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0in 0in 10pt 0.5in; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto" class="MsoNormal"&gt;&lt;span style="color: black; font-size: 8pt; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-bidi-font-family: calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;font face="Calibri"&gt;* Note, the MS Linux ODBC does not support distributed transaction &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="mso-ansi-language: en" lang="EN"&gt;&lt;font color="#000000" size="3" face="Calibri"&gt;See the following article for more details concerning linked servers: &lt;/font&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms188279.aspx"&gt;&lt;u&gt;&lt;font color="#0000ff" size="3" face="Calibri"&gt;http://msdn.microsoft.com/en-us/library/ms188279.aspx&lt;/font&gt;&lt;/u&gt;&lt;/a&gt; &lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="mso-ansi-language: en" lang="EN"&gt;&lt;font size="3"&gt;&lt;font color="#000000"&gt;&lt;font face="Calibri"&gt;As a test, I decided to use the following components: &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo2" class="MsoListParagraphCxSpFirst"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-fareast-font-family: calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: calibri; mso-bidi-theme-font: minor-latin; mso-ansi-language: en" lang="EN"&gt;&lt;span style="mso-list: ignore"&gt;&lt;font size="3" face="Calibri"&gt;1.&lt;/font&gt;&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-ansi-language: en" lang="EN"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;Redhat Enterprise Linux 5.x client configured with Microsoft Linux ODBC Driver. &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo2" class="MsoListParagraphCxSpMiddle"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-fareast-font-family: calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: calibri; mso-bidi-theme-font: minor-latin; mso-ansi-language: en" lang="EN"&gt;&lt;span style="mso-list: ignore"&gt;&lt;font size="3" face="Calibri"&gt;2.&lt;/font&gt;&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-ansi-language: en" lang="EN"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;SQL Server 2008 R2 configured with a linked server to IBM’s DB2 (using the Microsoft OLEDB Provider for DB2 ) &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="text-indent: -0.25in; margin: 0in 0in 10pt 0.5in; mso-list: l0 level1 lfo2" class="MsoListParagraphCxSpLast"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-fareast-font-family: calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: calibri; mso-bidi-theme-font: minor-latin; mso-ansi-language: en" lang="EN"&gt;&lt;span style="mso-list: ignore"&gt;&lt;font size="3" face="Calibri"&gt;3.&lt;/font&gt;&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-ansi-language: en" lang="EN"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;Sun’s Solaris 11 OS configured with IBM DB2 Version 9.7 Server (x64) &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="mso-ansi-language: en" lang="EN"&gt;       &lt;br /&gt;&lt;font size="3"&gt;&lt;font color="#000000"&gt;&lt;font face="Calibri"&gt;The goal is simply to return results &lt;i style="mso-bidi-font-style: normal"&gt;from &lt;/i&gt;an IBM DB2 9.7 system running on a Solaris 11 Unix system to a Redhat Linux workstation configured with the Microsoft Linux ODBC driver. &lt;span style="mso-spacerun: yes"&gt;&amp;#160;&lt;/span&gt;Of course, Microsoft SQL Server is sitting in the middle. &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="mso-ansi-language: en" lang="EN"&gt;&lt;font size="3"&gt;&lt;font color="#000000"&gt;&lt;font face="Calibri"&gt;From the Redhat Linux workstation, I created and executed the following script to create the linked server: &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;i style="mso-bidi-font-style: normal"&gt;&lt;span style="font-family: &amp;quot;Segoe&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: black; font-size: 10pt; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-bidi-font-family: tahoma" lang="EN"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;u&gt;&lt;span style="mso-ansi-language: en" lang="EN"&gt;&lt;font size="3"&gt;&lt;font color="#000000"&gt;&lt;font face="Calibri"&gt;createLinkedServer.sql &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/u&gt;&lt;/p&gt;    &lt;p style="margin: 0in 0in 10pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Segoe&amp;quot;,&amp;quot;sans-serif&amp;quot;; background: #f2f2f2; color: black; font-size: 8pt; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-shading-themecolor: background1; mso-shading-themeshade: 242"&gt;&lt;font size="1" face="Tahoma"&gt;IF&amp;#160; EXISTS (SELECT srv.name FROM sys.servers srv WHERE srv.server_id != 0 AND srv.name = N'SOLARIS2')EXEC master.dbo.sp_dropserver @server=N'SOLARIS2', @droplogins='droplogins'          &lt;br /&gt;          &lt;br /&gt;GO           &lt;br /&gt;EXEC master.dbo.sp_addlinkedserver @server = N'SOLARIS2', @srvproduct=N'DB2OLEDB', @provider=N'DB2OLEDB', @datasrc=N'Solaris2', @provstr=N'Provider=DB2OLEDB;User ID=gregorys;Password=password1;Initial Catalog=TEST;Network Transport Library=TCPIP;Host CCSID=1252;PC Code Page=1252;Network Address=65.53.9.96;Network Port=50000;Package Collection=TEST;Default Schema=DB2INST1;Process Binary as Character=False;Units of Work=RUW;DBMS Platform=DB2/6000;Defer Prepare=False;DateTime As Char=False;Rowset Cache Size=0;DateTime As Date=False;Auth Encrypt=False;AutoCommit=True;Authentication=Server;Decimal As Numeric=False;FastLoad Optimize=False;Derive Parameters=True;Persist Security Info=True;Data Source=TEST;Connection Pooling=False;'           &lt;br /&gt;          &lt;br /&gt;/* For security reasons the linked server remote logins password is changed with ######## */           &lt;br /&gt;EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname=N'SOLARIS2',@useself=N'False',@locallogin=NULL,@rmtuser=NULL,@rmtpassword=NULL           &lt;br /&gt;GO           &lt;br /&gt;EXEC master.dbo.sp_serveroption @server=N'SOLARIS2', @optname=N'collation compatible', @optvalue=N'true'           &lt;br /&gt;GO           &lt;br /&gt;EXEC master.dbo.sp_serveroption @server=N'SOLARIS2', @optname=N'data access', @optvalue=N'true'           &lt;br /&gt;GO           &lt;br /&gt;EXEC master.dbo.sp_serveroption @server=N'SOLARIS2', @optname=N'dist', @optvalue=N'false'           &lt;br /&gt;GO           &lt;br /&gt;EXEC master.dbo.sp_serveroption @server=N'SOLARIS2', @optname=N'pub', @optvalue=N'false'           &lt;br /&gt;GO&amp;#160; &lt;br /&gt;EXEC master.dbo.sp_serveroption @server=N'SOLARIS2', @optname=N'rpc', @optvalue=N'true'           &lt;br /&gt;GO           &lt;br /&gt;EXEC master.dbo.sp_serveroption @server=N'SOLARIS2', @optname=N'rpc out', @optvalue=N'true'           &lt;br /&gt;GO           &lt;br /&gt;EXEC master.dbo.sp_serveroption @server=N'SOLARIS2', @optname=N'sub', @optvalue=N'false'           &lt;br /&gt;GO           &lt;br /&gt;EXEC master.dbo.sp_serveroption @server=N'SOLARIS2', @optname=N'connect timeout', @optvalue=N'0'           &lt;br /&gt;GO           &lt;br /&gt;EXEC master.dbo.sp_serveroption @server=N'SOLARIS2', @optname=N'collation name', @optvalue=null           &lt;br /&gt;GO           &lt;br /&gt;EXEC master.dbo.sp_serveroption @server=N'SOLARIS2', @optname=N'lazy schema validation', @optvalue=N'false'           &lt;br /&gt;GO           &lt;br /&gt;EXEC master.dbo.sp_serveroption @server=N'SOLARIS2', @optname=N'query timeout', @optvalue=N'0'           &lt;br /&gt;GO           &lt;br /&gt;EXEC master.dbo.sp_serveroption @server=N'SOLARIS2', @optname=N'use remote collation', @optvalue=N'true'           &lt;br /&gt;GO           &lt;br /&gt;EXEC master.dbo.sp_serveroption @server=N'SOLARIS2', @optname=N'remote proc transaction promotion', @optvalue=N'true'           &lt;br /&gt;GO&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Segoe&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: black; font-size: 8pt; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font size="1" face="Tahoma"&gt;          &lt;br style="mso-special-character: line-break" /&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="mso-ansi-language: en" lang="EN"&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="font-family: &amp;quot;Segoe&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: black; font-size: 9pt; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-bidi-font-family: tahoma; mso-themecolor: text1"&gt;&lt;font face="Tahoma"&gt;sqlcmd -i ./createLinkedServer.sql -U xxx -P xxxx -S 65.53.9.94&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="mso-ansi-language: en" lang="EN"&gt; &lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="mso-ansi-language: en" lang="EN"&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p&gt;&lt;span style="mso-ansi-language: en" lang="EN"&gt;&lt;font size="3"&gt;&lt;font color="#000000"&gt;&lt;font face="Calibri"&gt;Next, I created a stored procedure to execute the linked query: &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;u&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: black; font-size: 10pt; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;"&gt;createStoreProcedure.sql &lt;/span&gt;&lt;/u&gt;&lt;/p&gt;    &lt;p style="margin: 0in 0in 10pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Segoe&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: black; font-size: 8pt; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font face="Tahoma"&gt;USE [Northwind]          &lt;br /&gt;GO           &lt;br /&gt;SET ANSI_NULLS ON           &lt;br /&gt;GO           &lt;br /&gt;SET QUOTED_IDENTIFIER ON           &lt;br /&gt;GO           &lt;br /&gt;CREATE PROCEDURE [dbo].[Solaris2]           &lt;br /&gt;AS           &lt;br /&gt;BEGIN           &lt;br /&gt;SET NOCOUNT ON;           &lt;br /&gt;SELECT [EMPNO],[FIRSTNME],[MIDINIT] ,[LASTNAME],[WORKDEPT],[PHONENO] ,[HIREDATE],[JOB] ,[EDLEVEL] ,[SEX],[BIRTHDATE],[SALARY],[BONUS],[COMM] FROM [SOLARIS2].[TEST].[DB2INST1].[EMPLOYEE];           &lt;br /&gt;          &lt;br /&gt;END           &lt;br /&gt;GO&lt;/font&gt; &lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="font-family: &amp;quot;Segoe&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: black; font-size: 9pt; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-bidi-font-family: tahoma; mso-themecolor: text1"&gt;&lt;font face="Tahoma"&gt;sqlcmd -i ./createStoreProcedure.sql -U xxx -P xxxx -S 65.53.9.94&lt;/font&gt; &lt;/span&gt;&lt;/b&gt;&lt;/p&gt;    &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="mso-ansi-language: en" lang="EN"&gt;&lt;font size="3"&gt;&lt;font color="#000000"&gt;&lt;font face="Calibri"&gt;And finally, I executed the stored procedure. &lt;span style="mso-spacerun: yes"&gt;&amp;#160;&lt;/span&gt; &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="mso-ansi-language: en" lang="EN"&gt;&lt;font size="3"&gt;&lt;font color="#000000"&gt;&lt;font face="Calibri"&gt;Below, we have Redhat Linux pulling data from Solaris/DB2 - compliments of the Microsoft Linux ODBC driver and SQL Server’s linked server functionality. &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; color: black; font-size: 8pt; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;"&gt;&lt;font size="1"&gt;1&amp;gt; solaris2          &lt;br /&gt;2&amp;gt; go           &lt;br /&gt;EMPNO&amp;#160; FIRSTNME&amp;#160;&amp;#160;&amp;#160;&amp;#160; MIDINIT LASTNAME&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; WORKDEPT PHONENO HIREDATE&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; JOB&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; EDLEVEL SEX BIRTHDATE&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SALARY&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; BONUS&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; COMM&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;------ ------------ ------- --------------- -------- ------- ---------------- -------- ------- --- ---------------- ----------- ----------- -----------           &lt;br /&gt;000010 CHRISTINE&amp;#160;&amp;#160;&amp;#160; I&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; HAAS&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; A00&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 3978&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1965-01-01 PRES&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 18 F&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1933-08-24&amp;#160;&amp;#160;&amp;#160; 52750.00&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1000.00&amp;#160;&amp;#160;&amp;#160;&amp;#160; 4220.00           &lt;br /&gt;000020 MICHAEL&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; L&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; THOMPSON&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; B01&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 3476&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1973-10-10 MANAGER&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 18 M&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1948-02-02&amp;#160;&amp;#160;&amp;#160; 41250.00&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 800.00&amp;#160;&amp;#160;&amp;#160;&amp;#160; 3300.00           &lt;br /&gt;000030 SALLY&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; A&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; KWAN&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; C01&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 4738&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1975-04-05 MANAGER&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 20 F&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1941-05-11&amp;#160;&amp;#160;&amp;#160; 38250.00&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 800.00&amp;#160;&amp;#160;&amp;#160;&amp;#160; 3060.00           &lt;br /&gt;000050 JOHN&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; B&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; GEYER&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; E01&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 6789&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1949-08-17 MANAGER&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 16 M&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1925-09-15&amp;#160;&amp;#160;&amp;#160; 40175.00&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 800.00&amp;#160;&amp;#160;&amp;#160;&amp;#160; 3214.00           &lt;br /&gt;000060 IRVING&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; F&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; STERN&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; D11&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 6423&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1973-09-14 MANAGER&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 16 M&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1945-07-07&amp;#160;&amp;#160;&amp;#160; 32250.00&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 500.00&amp;#160;&amp;#160;&amp;#160;&amp;#160; 2580.00           &lt;br /&gt;000070 EVA&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; D&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; PULASKI&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; D21&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 7831&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1980-09-30 MANAGER&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 16 F&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1953-05-26&amp;#160;&amp;#160;&amp;#160; 36170.00&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 700.00&amp;#160;&amp;#160;&amp;#160;&amp;#160; 2893.00           &lt;br /&gt;000090 EILEEN&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; W&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; HENDERSON&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; E11&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 5498&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1970-08-15 MANAGER&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 16 F&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1941-05-15&amp;#160;&amp;#160;&amp;#160; 29750.00&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 600.00&amp;#160;&amp;#160;&amp;#160;&amp;#160; 2380.00           &lt;br /&gt;000100 THEODORE&amp;#160;&amp;#160;&amp;#160;&amp;#160; Q&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SPENSER&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; E21&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0972&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1980-06-19 MANAGER&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 14 M&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1956-12-18&amp;#160;&amp;#160;&amp;#160; 26150.00&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 500.00&amp;#160;&amp;#160;&amp;#160;&amp;#160; 2092.00           &lt;br /&gt;000110 VINCENZO&amp;#160;&amp;#160;&amp;#160;&amp;#160; G&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; LUCCHESSI&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; A00&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 3490&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1958-05-16 SALESREP&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 19 M&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1929-11-05&amp;#160;&amp;#160;&amp;#160; 46500.00&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 900.00&amp;#160;&amp;#160;&amp;#160;&amp;#160; 3720.00           &lt;br /&gt;000120 SEAN&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; O'CONNELL&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; A00&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 2167&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1963-12-05 CLERK&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 14 M&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1942-10-18&amp;#160;&amp;#160;&amp;#160; 29250.00&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 600.00&amp;#160;&amp;#160;&amp;#160;&amp;#160; 2340.00           &lt;br /&gt;000130 DOLORES&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; M&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; QUINTANA&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; C01&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 4578&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1971-07-28 ANALYST&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 16 F&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1925-09-15&amp;#160;&amp;#160;&amp;#160; 23800.00&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 500.00&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1904.00           &lt;br /&gt;000140 HEATHER&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; A&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; NICHOLLS&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; C01&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1793&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1976-12-15 ANALYST&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 18 F&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1946-01-19&amp;#160;&amp;#160;&amp;#160; 28420.00&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 600.00&amp;#160;&amp;#160;&amp;#160;&amp;#160; 2274.00           &lt;br /&gt;000150 BRUCE&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ADAMSON&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; D11&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 4510&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1972-02-12 DESIGNER&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 16 M&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1947-05-17&amp;#160;&amp;#160;&amp;#160; 25280.00&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 500.00&amp;#160;&amp;#160;&amp;#160;&amp;#160; 2022.00           &lt;br /&gt;000160 ELIZABETH&amp;#160;&amp;#160;&amp;#160; R&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; PIANKA&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; D11&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 3782&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1977-10-11 DESIGNER&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 17 F&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1955-04-12&amp;#160;&amp;#160;&amp;#160; 22250.00&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 400.00&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1780.00           &lt;br /&gt;000170 MASATOSHI&amp;#160;&amp;#160;&amp;#160; J&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; YOSHIMURA&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; D11&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 2890&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1978-09-15 DESIGNER&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 16 M&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1951-01-05&amp;#160;&amp;#160;&amp;#160; 24680.00&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 500.00&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1974.00           &lt;br /&gt;000180 MARILYN&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; S&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SCOUTTEN&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; D11&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1682&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1973-07-07 DESIGNER&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 17 F&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1949-02-21&amp;#160;&amp;#160;&amp;#160; 21340.00&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 500.00&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1707.00           &lt;br /&gt;000190 JAMES&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; H&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; WALKER&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; D11&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 2986&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1974-07-26 DESIGNER&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 16 M&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1952-06-25&amp;#160;&amp;#160;&amp;#160; 20450.00&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 400.00&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1636.00           &lt;br /&gt;000200 DAVID&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; BROWN&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; D11&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 4501&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1966-03-03 DESIGNER&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 16 M&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1941-05-29&amp;#160;&amp;#160;&amp;#160; 27740.00&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 600.00&amp;#160;&amp;#160;&amp;#160;&amp;#160; 2217.00           &lt;br /&gt;000210 WILLIAM&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; T&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; JONES&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; D11&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0942&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1979-04-11 DESIGNER&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 17 M&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1953-02-23&amp;#160;&amp;#160;&amp;#160; 18270.00&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 400.00&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1462.00           &lt;br /&gt;000220 JENNIFER&amp;#160;&amp;#160;&amp;#160;&amp;#160; K&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; LUTZ&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; D11&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0672&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1968-08-29 DESIGNER&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 18 F&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1948-03-19&amp;#160;&amp;#160;&amp;#160; 29840.00&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 600.00&amp;#160;&amp;#160;&amp;#160;&amp;#160; 2387.00           &lt;br /&gt;000230 JAMES&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; J&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; JEFFERSON&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; D21&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 2094&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1966-11-21 CLERK&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 14 M&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1935-05-30&amp;#160;&amp;#160;&amp;#160; 22180.00&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 400.00&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1774.00           &lt;br /&gt;000240 SALVATORE&amp;#160;&amp;#160;&amp;#160; M&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; MARINO&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; D21&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 3780&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1979-12-05 CLERK&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 17 M&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1954-03-31&amp;#160;&amp;#160;&amp;#160; 28760.00&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 600.00&amp;#160;&amp;#160;&amp;#160;&amp;#160; 2301.00           &lt;br /&gt;000250 DANIEL&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; S&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SMITH&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; D21&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0961&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1969-10-30 CLERK&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 15 M&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1939-11-12&amp;#160;&amp;#160;&amp;#160; 19180.00&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 400.00&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1534.00           &lt;br /&gt;000260 SYBIL&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; P&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; JOHNSON&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; D21&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 8953&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1975-09-11 CLERK&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 16 F&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1936-10-05&amp;#160;&amp;#160;&amp;#160; 17250.00&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 300.00&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1380.00           &lt;br /&gt;000270 MARIA&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; L&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; PEREZ&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; D21&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 9001&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1980-09-30 CLERK&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 15 F&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1953-05-26&amp;#160;&amp;#160;&amp;#160; 27380.00&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 500.00&amp;#160;&amp;#160;&amp;#160;&amp;#160; 2190.00           &lt;br /&gt;000280 ETHEL&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; R&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SCHNEIDER&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; E11&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 8997&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1967-03-24 OPERATOR&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 17 F&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1936-03-28&amp;#160;&amp;#160;&amp;#160; 26250.00&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 500.00&amp;#160;&amp;#160;&amp;#160;&amp;#160; 2100.00           &lt;br /&gt;000290 JOHN&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; R&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; PARKER&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; E11&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 4502&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1980-05-30 OPERATOR&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 12 M&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1946-07-09&amp;#160;&amp;#160;&amp;#160; 15340.00&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 300.00&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1227.00           &lt;br /&gt;000300 PHILIP&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; X&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SMITH&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; E11&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 2095&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1972-06-19 OPERATOR&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 14 M&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1936-10-27&amp;#160;&amp;#160;&amp;#160; 17750.00&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 400.00&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1420.00           &lt;br /&gt;000310 MAUDE&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; F&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SETRIGHT&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; E11&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 3332&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1964-09-12 OPERATOR&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 12 F&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1931-04-21&amp;#160;&amp;#160;&amp;#160; 15900.00&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 300.00&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1272.00           &lt;br /&gt;000320 RAMLAL&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; V&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; MEHTA&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; E21&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 9990&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1965-07-07 FIELDREP&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 16 M&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1932-08-11&amp;#160;&amp;#160;&amp;#160; 19950.00&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 400.00&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1596.00           &lt;br /&gt;000330 WING&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; LEE&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; E21&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 2103&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1976-02-23 FIELDREP&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 14 M&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1941-07-18&amp;#160;&amp;#160;&amp;#160; 25370.00&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 500.00&amp;#160;&amp;#160;&amp;#160;&amp;#160; 2030.00           &lt;br /&gt;000340 JASON&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; R&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; GOUNOT&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; E21&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 5698&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1947-05-05 FIELDREP&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 16 M&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1926-05-17&amp;#160;&amp;#160;&amp;#160; 23840.00&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 500.00&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1907.00&lt;/font&gt;         &lt;br style="mso-special-character: line-break" /&gt;        &lt;br style="mso-special-character: line-break" /&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 8pt"&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font size="3"&gt;&lt;font color="#000000"&gt;&lt;font face="Calibri"&gt;Sometimes, it is easy to forget our implementation of the Linux based ODBC driver retains the same functionality found with our existing Windows based ODBC driver. &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font size="3"&gt;&lt;font color="#000000"&gt;&lt;font face="Calibri"&gt;I hope this topic helps you understand some of the capabilities of the Microsoft Linux ODBC driver. &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;/p&gt; &lt;/span&gt;  &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="mso-ansi-language: en" lang="EN"&gt;&lt;font size="3"&gt;&lt;font color="#000000"&gt;&lt;font face="Calibri"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10265572" width="1" height="1"&gt;</description></item><item><title>Use Existing MSDN C++ ODBC Samples for Microsoft Linux ODBC Driver</title><link>http://blogs.msdn.com/b/sqlblog/archive/2012/01/26/use-existing-msdn-c-odbc-samples-for-microsoft-linux-odbc-driver.aspx</link><pubDate>Thu, 26 Jan 2012 18:36:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10260954</guid><dc:creator>sqlblog</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/sqlblog/rsscomments.aspx?WeblogPostID=10260954</wfw:commentRss><comments>http://blogs.msdn.com/b/sqlblog/archive/2012/01/26/use-existing-msdn-c-odbc-samples-for-microsoft-linux-odbc-driver.aspx#comments</comments><description>&lt;p&gt;By Gregory Suarez | Sr. Escalation Engineer | SQL Server&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p style="margin: 0in 0in 12pt" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: black; font-size: 10pt"&gt;The CTP release of the Microsoft SQL Server ODBC Driver for Linux (&lt;a href="http://www.microsoft.com/download/en/details.aspx?id=28160"&gt;&lt;u&gt;&lt;font color="#0000ff"&gt;http://www.microsoft.com/download/en/details.aspx?id=28160&lt;/font&gt;&lt;/u&gt;&lt;/a&gt; ) opens many&amp;#160; opportunities for Red Hat Enterprise Linux (RHEL 5.x) customers who want to access the power of Microsoft SQL Server.       &lt;br /&gt;      &lt;br /&gt;&lt;font color="#000000"&gt;Well known utilities such as BCP (bulk copy) and SQLCMD are provided with the driver and their use is fairly straight forward; however; some customers have mentioned the absence of an SDK and C/C++ samples. These features are slated to be available shortly after the product RTM's at the end of March 2012 but in the meantime, you can use the existing MSDN ODBC C/C++ samples to get &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt"&gt;&lt;font color="#000000"&gt;you&lt;/font&gt;&lt;font color="#000000"&gt;&lt;span style="color: black"&gt; started.&amp;#160; &lt;br /&gt;          &lt;br /&gt;The Microsoft ODBC Linux driver shares a common code base &lt;/span&gt;&lt;span style="color: #1f497d"&gt;with &lt;/span&gt;&lt;/font&gt;&lt;span style="color: black"&gt;&lt;font color="#000000"&gt;its Windows ODBC counterpart and has been regression tested using many of the same test suites. With that said, many of the existing MSDN ODBC C/C++ samples that are console based should compile on Linux with only minor modifications.          &lt;br /&gt;&lt;/font&gt;        &lt;br /&gt;To get you started, I'll use &lt;strong&gt;SQLBindCol&lt;/strong&gt; sample found here: &lt;a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms711010%28v=vs.85%29.aspx"&gt;&lt;u&gt;&lt;font color="#0000ff"&gt;http://msdn.microsoft.com/en-us/library/windows/desktop/ms711010%28v=vs.85%29.aspx&lt;/font&gt;&lt;/u&gt;&lt;/a&gt; &lt;/span&gt;&lt;span style="color: #1f497d"&gt;            &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 12pt" class="MsoNormal"&gt;&lt;font color="#000000"&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt"&gt;A vast majority of Linux users will retrieve the data as SQLCHAR and will use printf.&amp;#160; This is different from typical Windows usage which is why I decided to use single byte below.&amp;#160; Note that the driver will return the SQLCHAR data as UTF8. &lt;/span&gt;&lt;span style="color: #1f497d"&gt;            &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: black; font-size: 10pt"&gt;Here is a list of changes made&lt;/span&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: #1f497d; font-size: 10pt"&gt;        &lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: black; font-size: 10pt"&gt;     &lt;br /&gt;1. Remove unneeded header files.&amp;#160; In particular&amp;#160; &amp;lt;windows.h&amp;gt; header.&amp;#160;&amp;#160; &lt;br /&gt;2. Replaced SQLWCHAR with SQLCHAR      &lt;br /&gt;3. Replaced wprintf with printf&lt;/span&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: #1f497d; font-size: 10pt"&gt;        &lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="color: #1f497d"&gt;     &lt;p&gt;&lt;font size="3" face="Calibri"&gt;&amp;#160;&lt;/font&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt; &lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: black; font-size: 10pt"&gt;   &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;     &lt;br /&gt;Here is the final source ready to be compiled on RHEL:&lt;/p&gt;    &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;        &lt;/p&gt; &lt;/span&gt;  &lt;p style="margin: 0in 0in 0pt; background: #f2f2f2" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; color: black; font-size: 8pt"&gt;#include &amp;lt;stdio.h&amp;gt;     &lt;br /&gt;#include &amp;lt;stdlib.h&amp;gt;      &lt;br /&gt;#include &amp;lt;sqlext.h&amp;gt;      &lt;br /&gt;#include &amp;lt;sql.h&amp;gt;      &lt;br /&gt;      &lt;br /&gt;#define NAME_LEN 50      &lt;br /&gt;#define PHONE_LEN 20      &lt;br /&gt;      &lt;br /&gt;void show_error() {      &lt;br /&gt;&amp;#160;&amp;#160; printf(&amp;quot;error\n&amp;quot;);      &lt;br /&gt;}      &lt;br /&gt;      &lt;br /&gt;int main() {      &lt;br /&gt;&amp;#160;&amp;#160; SQLHENV henv;      &lt;br /&gt;&amp;#160;&amp;#160; SQLHDBC hdbc;      &lt;br /&gt;&amp;#160;&amp;#160; SQLHSTMT hstmt = 0;      &lt;br /&gt;&amp;#160;&amp;#160; SQLRETURN retcode;      &lt;br /&gt;&amp;#160;&amp;#160; SQLCHAR szName[NAME_LEN], szPhone[PHONE_LEN], sCustID[NAME_LEN];      &lt;br /&gt;&amp;#160;&amp;#160; SQLLEN cbName = 0, cbCustID = 0, cbPhone = 0;      &lt;br /&gt;      &lt;br /&gt;&amp;#160;&amp;#160; // Allocate environment handle      &lt;br /&gt;&amp;#160;&amp;#160; retcode = SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &amp;amp;henv);      &lt;br /&gt;      &lt;br /&gt;&amp;#160;&amp;#160; // Set the ODBC version environment attribute      &lt;br /&gt;&amp;#160;&amp;#160; if (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO) {      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; retcode = SQLSetEnvAttr(henv, SQL_ATTR_ODBC_VERSION, (SQLPOINTER*)SQL_OV_ODBC3, 0);      &lt;br /&gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // Allocate connection handle      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO) {      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; retcode = SQLAllocHandle(SQL_HANDLE_DBC, henv, &amp;amp;hdbc);      &lt;br /&gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // Set login timeout to 5 seconds      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO) {      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SQLSetConnectAttr(hdbc, SQL_LOGIN_TIMEOUT, (SQLPOINTER)5, 0);      &lt;br /&gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // Connect to data source      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; retcode = SQLConnect(hdbc, (SQLCHAR*) &amp;quot;SQLCMD&amp;quot;, SQL_NTS, (SQLCHAR*) &amp;quot;Test1&amp;quot;, 5, (SQLCHAR*) &amp;quot;Password1&amp;quot;, 9);      &lt;br /&gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // Allocate statement handle      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO) {      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; retcode = SQLAllocHandle(SQL_HANDLE_STMT, hdbc, &amp;amp;hstmt);      &lt;br /&gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; retcode = SQLExecDirect (hstmt, (SQLCHAR *) &amp;quot;SELECT CustomerID, ContactName, Phone FROM CUSTOMERS ORDER BY 2, 1, 3&amp;quot;, SQL_NTS);      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO) {      &lt;br /&gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // Bind columns 1, 2, and 3      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; retcode = SQLBindCol(hstmt, 1, SQL_C_CHAR, sCustID, 100, &amp;amp;cbCustID);      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; retcode = SQLBindCol(hstmt, 2, SQL_C_CHAR, szName, NAME_LEN, &amp;amp;cbName);      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; retcode = SQLBindCol(hstmt, 3, SQL_C_CHAR, szPhone, PHONE_LEN, &amp;amp;cbPhone);      &lt;br /&gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // Fetch and print each row of data. On an error, display a message and exit.      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; for (int i=0 ; ; i++) {      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; retcode = SQLFetch(hstmt);      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (retcode == SQL_ERROR || retcode == SQL_SUCCESS_WITH_INFO)      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; show_error();      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO)      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; printf( &amp;quot;%d: %s %s %s\n&amp;quot;, i + 1, sCustID, szName, szPhone);      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; else      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; break;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }      &lt;br /&gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // Process data      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO) {      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SQLCancel(hstmt);      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SQLFreeHandle(SQL_HANDLE_STMT, hstmt);      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }      &lt;br /&gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SQLDisconnect(hdbc);      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }      &lt;br /&gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SQLFreeHandle(SQL_HANDLE_DBC, hdbc);      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SQLFreeHandle(SQL_HANDLE_ENV, henv);      &lt;br /&gt;&amp;#160;&amp;#160; }      &lt;br /&gt;}          &lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: black; font-size: 10pt"&gt;     &lt;p&gt;&amp;#160;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: black; font-size: 10pt"&gt;Public ODBC headers are installed with unixODBC 2.3.0 and are typically included in the /usr/include/odbc directory.&amp;#160;    &lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: black; font-size: 10pt"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: black; font-size: 10pt"&gt;Be sure your IDE is configured correctly to find the headers and also be sure to link to the odbc library object using the –lodbc switch.         &lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: black; font-size: 10pt"&gt;I was able to compile the program above using the following command line options:        &lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 12pt" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;; background: #f2f2f2; color: black; font-size: 10pt"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 12pt" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;; background: #f2f2f2; color: black; font-size: 10pt"&gt;cc -m64 -g -I/usr/include -L/usr/lib -lodbc -o SQLBindColtest SQLBindColtest.c&lt;/span&gt;     &lt;/p&gt;  &lt;p&gt;&lt;span style="font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 11pt; mso-fareast-font-family: calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: en-us; mso-fareast-language: en-us; mso-bidi-language: ar-sa"&gt;&lt;font color="#000000"&gt;Good luck and I hope this helps you get started with writing C/C++ application that use the Microsoft Linux ODBC driver.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10260954" width="1" height="1"&gt;</description></item><item><title>How to get "Microsoft.sqlserver.msxml6_interop.dll" without buying SQL Server 2008</title><link>http://blogs.msdn.com/b/sqlblog/archive/2011/12/07/how-to-get-quot-microsoft-sqlserver-msxml6-interop-dll-quot-without-buying-sql-server-2008.aspx</link><pubDate>Wed, 07 Dec 2011 22:51:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10245313</guid><dc:creator>sqlblog</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/sqlblog/rsscomments.aspx?WeblogPostID=10245313</wfw:commentRss><comments>http://blogs.msdn.com/b/sqlblog/archive/2011/12/07/how-to-get-quot-microsoft-sqlserver-msxml6-interop-dll-quot-without-buying-sql-server-2008.aspx#comments</comments><description>&lt;p&gt;The other day I was working with a customer who was in the process of developing SSIS &amp;quot;Control Flow&amp;quot; custom component. He was having an issue in compiling/building his code in Visual Studio and getting &lt;/p&gt;  &lt;p&gt;Warning about the build process about indirect dependency on the .NET Framework assembly due to SSIS references.&lt;/p&gt;  &lt;p&gt;Error:&lt;/p&gt;  &lt;p&gt;The primary reference &amp;quot;Microsoft.SQLServer.ManagedDTS, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL&amp;quot; could not be resolved because it has an indirect dependency on the .NET Framework assembly &amp;quot;mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&amp;quot; which has a higher version &amp;quot;2.0.3600.0&amp;quot; than the version &amp;quot;2.0.0.0&amp;quot; in the current target framework. &lt;/p&gt;  &lt;p&gt;The cause and resolution of this error as it is explained by our escalation engineer Jason at: &lt;a href="http://blogs.msdn.com/b/jason_howell/archive/2010/08/18/visual-studio-2010-solution-build-process-give-a-warning-about-indirect-dependency-on-the-net-framework-assembly-due-to-ssis-references.aspx"&gt;http://blogs.msdn.com/b/jason_howell/archive/2010/08/18/visual-studio-2010-solution-build-process-give-a-warning-about-indirect-dependency-on-the-net-framework-assembly-due-to-ssis-references.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;As per the article this problem affects machines where SQL Server 2005 was once installed. Even if SQL Server 2008 or SQL Server 2008 R2 is currently installed, if at some point SQL Server 2005 was installed in the past, the problem assembly may exist in the Globally Assembly Cache (GAC). The problem is related to the way assemblies reference the SQL Server 2005 version of Microsoft.SQLServer.msxml6_interop.dll. That msxml_interop assembly in turn references mscorlib.dll that is version 2.0.3600, which is the prerelease Beta 2 of .NET 2.0. &lt;/p&gt;  &lt;p&gt;The resolution of this issue is update the version of the Microsoft.SQLServer.msxml6_interop.dll in the GAC with a copy of the file from SQL Server 2008 installation that has the correct references to .Net 2.0 RTM (ie. get rid of the beta reference). My customer did not have SQL Server 2008 and he was not ready to buy SQL Server 2008 only to get this DLL. &lt;/p&gt;  &lt;p&gt;I am going to talk about how you can get Microsoft.SQLServer.msxml6_interop.dll without buying SQL Server 2008 or 2008 R2.&lt;/p&gt;  &lt;p&gt; SQL 2008 Management Studio Express which is free download has this DLL. You can get it by following the steps below:&lt;/p&gt;  &lt;p&gt;a) You can install SQL 2008 Management Studio Express on a machine where you do not have SQL 2005 installed, Management Studio Express can be found at: &lt;a href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;amp;id=7593"&gt;http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;amp;id=7593&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;b) This will install Microsoft.SqlServer.Msxml6_interop.dll into GAC. &lt;/p&gt;  &lt;p&gt;c) If you want to get a copy of this dll then you can copy GAC dll using the command: &lt;/p&gt;  &lt;p&gt;xcopy c:\windows\assembly\*Microsoft.SQLServer.msxml6_interop.dll* C:\GACCopy\/s/r&lt;/p&gt;  &lt;p&gt;d) The dll will be in the folder at: C:\GACCopy\GAC_MSIL\Microsoft.SqlServer.Msxml6_interop\6.0.0.0__89845dcd8080cc91&lt;/p&gt;  &lt;p&gt;Install this copy the DLL into the GAC on the machine where Visual Studio is used to build the solutions. If you have any issue in installing the DLL in GAC, Jason’s article has some tips.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Author : Faiz (MSFT), SQL Developer Engineer&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10245313" width="1" height="1"&gt;</description></item><item><title>Setting up database mirroring with certificates</title><link>http://blogs.msdn.com/b/sqlblog/archive/2011/08/24/setting-up-database-mirroring-with-certificates.aspx</link><pubDate>Wed, 24 Aug 2011 23:09:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10200033</guid><dc:creator>sqlblog</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/sqlblog/rsscomments.aspx?WeblogPostID=10200033</wfw:commentRss><comments>http://blogs.msdn.com/b/sqlblog/archive/2011/08/24/setting-up-database-mirroring-with-certificates.aspx#comments</comments><description>&lt;p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;We use certificates while setting up database mirroring for two partners that are in a workgroup or in non-trusted domains.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;The idea is to create a certificate on each partner, export it to the other and then setup a login to use that certificate. As explained in BOL &lt;a href="http://msdn.microsoft.com/en-us/library/ms191140(SQL.90).aspx"&gt;here&lt;/a&gt;, this is called setting up Inbound and Outbound connections&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;Here is a simplified representation of how it needs to be setup&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="mso-ignore: vglayout"&gt;     &lt;table style="line-height: normal" cellspacing="0" cellpadding="0" align="left"&gt;&lt;tbody&gt;         &lt;tr&gt;           &lt;td height="4" width="3"&gt;&lt;/td&gt;         &lt;/tr&gt;          &lt;tr&gt;           &lt;td&gt;&lt;/td&gt;            &lt;td&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-65-metablogapi/6087.clip_5F00_image0018_5F00_3451F3EA.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image001[8]" border="0" alt="clip_image001[8]" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-65-metablogapi/0537.clip_5F00_image0018_5F00_thumb_5F00_08A129EE.png" width="573" height="286" /&gt;&lt;/a&gt;&lt;/td&gt;         &lt;/tr&gt;       &lt;/tbody&gt;&lt;/table&gt;   &lt;/span&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;br style="mso-ignore: vglayout" clear="all" /&gt;  &lt;p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"&gt;   &lt;p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;   &lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;If either of these is not setup correctly you can get a variety of error messages like these &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt" color="#ff0000"&gt;Msg 1431, Level 16, State 4, Line 1&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt" color="#ff0000"&gt;Neither the partner nor the witness server instance for database &amp;quot;TEST2&amp;quot; is available. Reissue the command when at least one of the instances becomes available.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt" color="#ff0000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt" color="#ff0000"&gt;Error: 1438, Severity: 16, State: 1.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt" color="#ff0000"&gt;The server instance Partner rejected configure request; read its error log file for more information. The reason 1405, and state 2, can be of use for diagnostics by Microsoft. This is a transient error hence retrying the request is likely to succeed. Correct the cause if any and retry.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="line-height: 12pt; font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt" color="#ff0000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="line-height: 12pt; font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt" color="#ff0000"&gt;Error: 1405, Severity: 16, State: 2&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="line-height: 12pt; font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt" color="#ff0000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;Apart from the blog post above, you can refer to Bemis 2189705 for a step by step approach to setting up database mirroring with certificates. &lt;span style="mso-spacerun: yes"&gt;&amp;#160;&lt;/span&gt;The steps consist of the following &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: 13pt; list-style-type: disc; text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class="MsoListParagraphCxSpFirst"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-bidi-font-family: calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;span style="mso-list: ignore"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt"&gt;1.&lt;/font&gt;&lt;/font&gt;&lt;span style="line-height: normal; font-family: "&gt;&lt;font face="Times New Roman"&gt;&lt;font style="font-size: 7pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt"&gt;Setup Outbound connections:- Consists of creating the certificate, the endpoint ( with the certificate in the AUTHENTICATION clause) and then backing up the certificate&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: 13pt; list-style-type: disc; text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class="MsoListParagraphCxSpMiddle"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-bidi-font-family: calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;span style="mso-list: ignore"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt"&gt;2.&lt;/font&gt;&lt;/font&gt;&lt;span style="line-height: normal; font-family: "&gt;&lt;font face="Times New Roman"&gt;&lt;font style="font-size: 7pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt"&gt;Setup Inbound connections:-&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;Consists of restoring the certificate from the partner, associating it with a login and granting that login connect on the endpoint&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: 13pt; list-style-type: disc; text-indent: -0.25in; margin: 0in 0in 10pt 0.5in; mso-list: l0 level1 lfo1" class="MsoListParagraphCxSpLast"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-bidi-font-family: calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;span style="mso-list: ignore"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt"&gt;3.&lt;/font&gt;&lt;/font&gt;&lt;span style="line-height: normal; font-family: "&gt;&lt;font face="Times New Roman"&gt;&lt;font style="font-size: 7pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt"&gt;Run the ALTER DATABASE statements starting with Mirror server&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;first and then on Principal&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;In order to avoid confusion, be sure to use two separate local accounts on each partner and name them with the prefix of the machine name for the other partner.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font color="#000000" face="Calibri"&gt;&lt;font style="font-size: 11pt"&gt;Also, we shall see these error messages while trying to use the GUI to setup database mirroring on Sql Server 2005 as outlined in &lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: 11pt"&gt;&lt;a style="cursor: auto" href="http://connect.microsoft.com/SQLServer/feedback/details/343027/database-mirroring-gui-does-not-work-and-throws-fqdn-error"&gt;&lt;font color="#0000ff" face="Calibri"&gt;&lt;u&gt;http://connect.microsoft.com/SQLServer/feedback/details/343027/database-mirroring-gui-does-not-work-and-throws-fqdn-error&lt;/u&gt;&lt;/font&gt;&lt;/a&gt;&lt;/font&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt"&gt;&lt;span class="MsoHyperlink"&gt;&lt;font color="#0000ff"&gt;&lt;u&gt; &lt;span style="mso-spacerun: yes"&gt;&amp;#160;&lt;/span&gt;&lt;/u&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#1f497d"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&lt;/span&gt;- &lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;which means setting up mirroring using certificates through SSMS is not possible on Yukon SSMS but is possible for Katmai and above.&lt;/font&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;&lt;strong&gt;&lt;u&gt;Example Scripts that you can use in your environment&lt;/u&gt;&lt;/strong&gt; &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt" color="#008000"&gt;--1.Setup Outbound connections:- Consists of creating the certificate, the endpoint ( with the certificate in the AUTHENTICATION clause) &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt" color="#008000"&gt;--and then backing up the certificate&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Courier New"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 10pt"&gt;USE&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-no-proof: yes"&gt;&lt;font style="font-size: 10pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 10pt" color="#0000ff"&gt;master&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Courier New"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 10pt"&gt;CREATE&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-no-proof: yes"&gt;&lt;font style="font-size: 10pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;CERTIFICATE&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; HOST_PRINCIPAL_cert &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Courier New"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 10pt"&gt;WITH&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-no-proof: yes"&gt;&lt;font style="font-size: 10pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;SUBJECT&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;=&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;'HOST_PRINCIPAL certificate'&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 10pt" color="#808080"&gt;,&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Courier New"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 10pt"&gt;START_DATE&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-no-proof: yes"&gt;&lt;font style="font-size: 10pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;=&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 10pt" color="#ff0000"&gt;'08/19/2011'&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt" color="#0000ff"&gt;GO&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt" color="#0000ff"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Courier New"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 10pt"&gt;CREATE&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-no-proof: yes"&gt;&lt;font style="font-size: 10pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;ENDPOINT&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; Endpoint_Mirroring&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Courier New"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 10pt"&gt;STATE&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-no-proof: yes"&gt;&lt;font style="font-size: 10pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;=&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 10pt" color="#0000ff"&gt;STARTED&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Courier New"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 10pt"&gt;AS&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-no-proof: yes"&gt;&lt;font style="font-size: 10pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;TCP &lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;LISTENER_PORT&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;=&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;5022&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;,&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;LISTENER_IP&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;=&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;ALL)&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Courier New"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 10pt"&gt;FOR&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-no-proof: yes"&gt;&lt;font style="font-size: 10pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#008000"&gt;DATABASE_MIRRORING&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Courier New"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 10pt"&gt;AUTHENTICATION&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-no-proof: yes"&gt;&lt;font style="font-size: 10pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;=&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;CERTIFICATE&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; HOST_PRINCIPAL_cert&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Courier New"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font color="#808080"&gt;&lt;font style="font-size: 10pt"&gt;,&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-no-proof: yes"&gt;&lt;font style="font-size: 10pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;ROLE&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;=&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 10pt" color="#808080"&gt;ALL);&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt" color="#0000ff"&gt;GO&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt" color="#0000ff"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Courier New"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 10pt"&gt;BACKUP&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-no-proof: yes"&gt;&lt;font style="font-size: 10pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;CERTIFICATE&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; HOST_PRINCIPAL_cert &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;TO&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;FILE&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;=&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;'C:\temp\HOST_PRINCIPAL_cert.cer'&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 10pt" color="#808080"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt" color="#0000ff"&gt;GO&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="line-height: 12pt; font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt" color="#008000"&gt;--2. Copy this ceritificate to the Mirror machine&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt" color="#008000"&gt;--3.Setup Outbound connections:- Consists of creating the certificate, the endpoint ( with the certificate in the AUTHENTICATION clause) &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt" color="#008000"&gt;--and then backing up the certificate&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Courier New"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 10pt"&gt;CREATE&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-no-proof: yes"&gt;&lt;font style="font-size: 10pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;CERTIFICATE&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; HOST_MIRROR_cert &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Courier New"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 10pt"&gt;WITH&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-no-proof: yes"&gt;&lt;font style="font-size: 10pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;SUBJECT&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;=&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;'HOST_MIRROR_certificate'&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 10pt" color="#808080"&gt;,&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Courier New"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 10pt"&gt;START_DATE&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-no-proof: yes"&gt;&lt;font style="font-size: 10pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;=&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 10pt" color="#ff0000"&gt;'08/19/2011'&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt" color="#0000ff"&gt;GO&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt" color="#0000ff"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Courier New"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 10pt"&gt;CREATE&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-no-proof: yes"&gt;&lt;font style="font-size: 10pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;ENDPOINT&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; Endpoint_Mirroring&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Courier New"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 10pt"&gt;STATE&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-no-proof: yes"&gt;&lt;font style="font-size: 10pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;=&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 10pt" color="#0000ff"&gt;STARTED&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Courier New"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 10pt"&gt;AS&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-no-proof: yes"&gt;&lt;font style="font-size: 10pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;TCP &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 10pt" color="#808080"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Courier New"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 10pt"&gt;LISTENER_PORT&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 10pt"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font color="#808080"&gt;=&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; mso-no-proof: yes"&gt;&lt;font style="font-size: 10pt" color="#000000"&gt;5022&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Courier New"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font color="#808080"&gt;&lt;font style="font-size: 10pt"&gt;,&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-no-proof: yes"&gt;&lt;font style="font-size: 10pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;LISTENER_IP&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;=&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 10pt" color="#808080"&gt;ALL&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Courier New"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font color="#808080"&gt;&lt;font style="font-size: 10pt"&gt;)&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-no-proof: yes"&gt;&lt;font style="font-size: 10pt" color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Courier New"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 10pt"&gt;FOR&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-no-proof: yes"&gt;&lt;font style="font-size: 10pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#008000"&gt;DATABASE_MIRRORING&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Courier New"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 10pt"&gt;AUTHENTICATION&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-no-proof: yes"&gt;&lt;font style="font-size: 10pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;=&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;CERTIFICATE&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; HOST_MIRROR_cert&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Courier New"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font color="#808080"&gt;&lt;font style="font-size: 10pt"&gt;,&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-no-proof: yes"&gt;&lt;font style="font-size: 10pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;ROLE&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;=&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 10pt" color="#808080"&gt;ALL&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt" color="#808080"&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt" color="#0000ff"&gt;GO&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Courier New"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 10pt"&gt;BACKUP&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-no-proof: yes"&gt;&lt;font style="font-size: 10pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;CERTIFICATE&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; HOST_MIRROR_cert &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;TO&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;FILE&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;=&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;'C:\temp\HOST_MIRROR_cert.cer'&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 10pt" color="#808080"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt" color="#0000ff"&gt;GO&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="line-height: 12pt; font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt" color="#008000"&gt;--4. Copy this certificate to the Principal machine&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt" color="#008000"&gt;--5.Setup Inbound connections:-&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;Consists of restoring the certificate from the partner, associating it with a login and granting that login connect &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt" color="#008000"&gt;--on the endpoint&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt" color="#008000"&gt;--Create the login for the Mirror machine and associate the mirror cert with the login &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Courier New"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 10pt"&gt;USE&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-no-proof: yes"&gt;&lt;font style="font-size: 10pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;master&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 10pt" color="#808080"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Courier New"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 10pt"&gt;CREATE&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-no-proof: yes"&gt;&lt;font style="font-size: 10pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;LOGIN&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; HOST_MIRROR_login &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;WITH&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;PASSWORD&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;=&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;'1Sample_Strong_Password!@#'&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 10pt" color="#808080"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt" color="#0000ff"&gt;GO&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Courier New"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 10pt"&gt;CREATE&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-no-proof: yes"&gt;&lt;font style="font-size: 10pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff00ff"&gt;USER&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; HOST_MIRROR_user &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;FOR&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;LOGIN&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; HOST_MIRROR_login&lt;/font&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 10pt" color="#808080"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt" color="#0000ff"&gt;GO&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt" color="#008000"&gt;--Associate the certificate with the user. &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Courier New"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 10pt"&gt;CREATE&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-no-proof: yes"&gt;&lt;font style="font-size: 10pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;CERTIFICATE&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; HOST_MIRROR_cert&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Courier New"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 10pt"&gt;AUTHORIZATION&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-no-proof: yes"&gt;&lt;font style="font-size: 10pt" color="#000000"&gt; HOST_MIRROR_user&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Courier New"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 10pt"&gt;FROM&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-no-proof: yes"&gt;&lt;font style="font-size: 10pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;FILE&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;=&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 10pt" color="#ff0000"&gt;'C:\temp\HOST_MIRROR_cert.cer'&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt" color="#0000ff"&gt;GO&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt" color="#008000"&gt;--Grant connect on the endpoint to the login &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Courier New"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 10pt"&gt;GRANT&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-no-proof: yes"&gt;&lt;font style="font-size: 10pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;CONNECT&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;ON&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;ENDPOINT&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;::&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;Endpoint_Mirroring &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;TO&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; [HOST_MIRROR_login]&lt;/font&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 10pt" color="#808080"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="line-height: 12pt; font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt" color="#0000ff"&gt;GO&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt" color="#008000"&gt;--6.Setup Inbound connections:-&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;Consists of restoring the certificate from the partner, associating it with a login and granting that login connect &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt" color="#008000"&gt;--on the endpoint&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt" color="#008000"&gt;--Create the login for the Principal machine and associate the principal cert with the login &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Courier New"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 10pt"&gt;USE&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-no-proof: yes"&gt;&lt;font style="font-size: 10pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;master&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 10pt" color="#808080"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Courier New"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 10pt"&gt;CREATE&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-no-proof: yes"&gt;&lt;font style="font-size: 10pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;LOGIN&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; HOST_PRINCIPAL_login &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;WITH&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;PASSWORD&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;=&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;'=Sample#2_Strong_Password2'&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 10pt" color="#808080"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt" color="#0000ff"&gt;GO&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt" color="#0000ff"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Courier New"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 10pt"&gt;CREATE&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-no-proof: yes"&gt;&lt;font style="font-size: 10pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff00ff"&gt;USER&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; HOST_PRINCIPAL_user &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;FOR&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;LOGIN&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; HOST_PRINCIPAL_login&lt;/font&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 10pt" color="#808080"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt" color="#0000ff"&gt;GO&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt" color="#008000"&gt;--Associate the certificate with the user.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Courier New"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 10pt"&gt;CREATE&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-no-proof: yes"&gt;&lt;font style="font-size: 10pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;CERTIFICATE&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; HOST_PRINCIPAL_cert&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Courier New"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 10pt"&gt;AUTHORIZATION&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-no-proof: yes"&gt;&lt;font style="font-size: 10pt" color="#000000"&gt; HOST_PRINCIPAL_user&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Courier New"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 10pt"&gt;FROM&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-no-proof: yes"&gt;&lt;font style="font-size: 10pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;FILE&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;=&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 10pt" color="#ff0000"&gt;'C:\temp\HOST_PRINCIPAL_cert.cer'&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt" color="#0000ff"&gt;GO&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt" color="#008000"&gt;--Grant connect on the endpoint to the login &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Courier New"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 10pt"&gt;GRANT&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-no-proof: yes"&gt;&lt;font style="font-size: 10pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;CONNECT&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;ON&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;ENDPOINT&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;::&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;Endpoint_Mirroring &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;TO&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; [HOST_PRINCIPAL_login]&lt;/font&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 10pt" color="#808080"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="line-height: 12pt; font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt" color="#0000ff"&gt;GO&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: ; mso-no-proof: yes"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;Here is a list of common troubleshooting steps to do when you are stuck with these error messages&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;1. Telnet to the ports works correctly from each machine to the other&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;2. &lt;span style="mso-spacerun: yes"&gt;&amp;#160;&lt;/span&gt;Output of netstat –abn shows that ports are opened on both sides as expected&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;Principal &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="font-family: "&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;TCP&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;0.0.0.0:5022&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;0.0.0.0:0&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;LISTENING&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;5068&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="font-family: "&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 11pt"&gt;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 11pt"&gt;[sqlservr.exe]&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;Mirror&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="font-family: "&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 11pt"&gt;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 11pt"&gt;TCP&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;0.0.0.0:5023&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;0.0.0.0:0&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&lt;/span&gt;LISTENING&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;5052&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="font-family: "&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 11pt"&gt;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 11pt"&gt;[sqlservr.exe]&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;4. Check the output of sys.database_mirroring_endpoints is identical on both sides&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="font-family: "&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;End_Mirroring&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;65545 273&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;2&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;TCP&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;4&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;DATABASE_MIRRORING&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;0&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="background-image: none; background-attachment: scroll; background-repeat: repeat; background-position: 0% 0%; mso-highlight: yellow"&gt;&lt;font style="background-color: #ffff00"&gt;STARTED&lt;/font&gt;&lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;0&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;3&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;ALL&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;1&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;4&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="background-image: none; background-attachment: scroll; background-repeat: repeat; background-position: 0% 0%; mso-highlight: yellow"&gt;&lt;font style="background-color: #ffff00"&gt;CERTIFICATE 258&lt;/font&gt;&lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;1&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;RC4&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="font-family: "&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;End_Mirroring&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;65545 273&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;2&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;TCP&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;4&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;DATABASE_MIRRORING&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;0&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;STARTED&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;0&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;3&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;ALL&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;1&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;4&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;CERTIFICATE 258&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;1&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;RC4&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;5. Run the Metadata check query from BOL and check that the respective logins have correct CONNECT permissions on&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;each partner&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Courier New"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 10pt"&gt;SELECT&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-no-proof: yes"&gt;&lt;font style="font-size: 10pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;'Metadata Check'&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 10pt" color="#808080"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Courier New"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 10pt"&gt;SELECT&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-no-proof: yes"&gt;&lt;font style="font-size: 10pt"&gt;&lt;font color="#000000"&gt; EP&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;.&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;name&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;,&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; SP&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;.&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;STATE&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;,&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 10pt"&gt;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 10pt"&gt;&lt;span style="color: "&gt;&lt;font color="#ff00ff"&gt;CONVERT&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;nvarchar&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;38&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;),&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff00ff"&gt;suser_name&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;SP&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;.&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;grantor_principal_id&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;))&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 10pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 10pt"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;AS&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; GRANTOR&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;,&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 10pt"&gt;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 10pt"&gt;SP&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: 10pt"&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;.&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;TYPE&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;AS&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; PERMISSION&lt;/font&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 10pt" color="#808080"&gt;,&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 10pt"&gt;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 10pt"&gt;&lt;span style="color: "&gt;&lt;font color="#ff00ff"&gt;CONVERT&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;nvarchar&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;46&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;),&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff00ff"&gt;suser_name&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;SP&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;.&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;grantee_principal_id&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;))&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 10pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 10pt"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;AS&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; GRANTEE &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 10pt"&gt;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 10pt"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;FROM&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#008000"&gt;sys&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;.&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#008000"&gt;server_permissions&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; SP &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;,&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#008000"&gt;sys&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;.&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#008000"&gt;endpoints&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; EP&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 10pt"&gt;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 10pt"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;WHERE&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; SP&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;.&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;major_id &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;=&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; EP&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;.&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;endpoint_id&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 10pt"&gt;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 10pt"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;ORDER&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;BY&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; Permission&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;,&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;grantor&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;,&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; grantee&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-no-proof: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt" color="#0000ff"&gt;GO&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;6. Try removing the ENCRYPTION clause from the endpoint definition and recreating it. This is relevant when the Sql Server is hosted on virtual machine in Vmware environment.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font color="#000000" face="Calibri"&gt;&lt;font style="font-size: 11pt"&gt;7. Try dropping and recreating the local account on each side that is being used for DBM. This will only be required if they are using local windows accounts and they have moved the database from one server to another with the same local account existing on both the machines or if they have moved to another domain where the same domain user exists as the previous domain. This is similar to the orphaned logins issue with SQL &lt;/font&gt;&lt;/font&gt;&lt;a style="cursor: auto" href="http://blogs.msdn.com/b/sqlserverfaq/archive/2009/04/13/orphaned-users-with-database-mirroring-and-log-shipping.aspx"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#0000ff"&gt;&lt;u&gt;Authentication for Database Mirroring&lt;/u&gt;&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"&gt;&amp;#160;&lt;/p&gt;  &lt;p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"&gt;Rohit Nayak &lt;/p&gt;  &lt;p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"&gt;Sr. Support Engineer – Sql Server CTS&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10200033" width="1" height="1"&gt;</description></item><item><title>Sending several files to several individuals using SSIS Send Email Task</title><link>http://blogs.msdn.com/b/sqlblog/archive/2011/06/14/sending-several-files-to-several-individuals-using-ssis-send-email-task.aspx</link><pubDate>Wed, 15 Jun 2011 01:15:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10174622</guid><dc:creator>sqlblog</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/sqlblog/rsscomments.aspx?WeblogPostID=10174622</wfw:commentRss><comments>http://blogs.msdn.com/b/sqlblog/archive/2011/06/14/sending-several-files-to-several-individuals-using-ssis-send-email-task.aspx#comments</comments><description>&lt;p&gt;Recently I got a case and the customer was trying to create an SSIS package to e-mail results of several files to several individuals and he wanted to know if there is any inbuilt task in SSIS out of the box that can do this. He was saving few files in a folder and wanted to send some of the files from that folder that start with a certain series of characters (wildcards) as attachments to the emails.&amp;#160; He was trying to do that using SQL Server and SSIS 2008 R2.&lt;/p&gt;  &lt;p&gt;After some research I was certain that there is no inbuilt task in SSIS that can achieve this directly. Then I started to work on alternate solutions using the exiting tasks that we have in SSIS. We came up with a solution and I thought there are other users out there who may need to do something similar from an SSIS package. So in this blog I will list the detail steps (with a lot of screenshots) of the solution that we provided to that customer. In summary we suggested the following as an alternate to achieve the customer’s goal.&lt;/p&gt;  &lt;p&gt;I) Using a ForEach Loop container, you can loop over all the files in a folder, and save each file into a variable “MyFIle” file. &lt;/p&gt;  &lt;p&gt;II) Inside the loop use a Script Task to append each file string from current file to a global string variable “Myfiles” + concatenate the | character, into a delimited list of individual files. &lt;/p&gt;  &lt;p&gt;III) Then outside the loop (after it) use a send mail task with an expression set on the FileAttachments property to point to @[User::MyFiles]&lt;/p&gt;  &lt;p&gt;Later I made a sample SSIS package implementing the above steps and it worked like a charm.&amp;#160; In the package I used a &lt;b&gt;ForEachLoop Container&lt;/b&gt; and a &lt;b&gt;Script Task&lt;/b&gt; to select multiple attachments from a folder using the wild card and then used a &lt;b&gt;Send Email Task&lt;/b&gt; to send the email to multiple recipients with the attachments. Below I am listing steps with screen shoots.&lt;/p&gt;  &lt;p&gt;1. Open up a new Integration Services Project under Boniness Intelligence Projects in Visual Studio 2008 and name it SendEmailTest (or any name that you want J)&lt;/p&gt;  &lt;p&gt;2. Drag and drop a &lt;b&gt;Foreach Loop Container&lt;/b&gt;.&lt;/p&gt;  &lt;p&gt;3. Double click &lt;b&gt;Foreach Loop Container&lt;/b&gt; task, go to the Collection Tab and do the following &lt;/p&gt;  &lt;p&gt;a. Select “Foreach File Enumerator” in the Enumerator field &lt;/p&gt;  &lt;p&gt;b. Click the browse button and navigate to the folder location where you have the files that you want to attach&lt;/p&gt;  &lt;p&gt;c. Type the wild card string value as per your requirement &lt;/p&gt;  &lt;p&gt;&lt;i&gt;Example: Att*.txt &lt;/i&gt;&lt;i&gt;à&lt;/i&gt;&lt;i&gt; this will loop through all the files that start with “Att” and has the extension “.txt”.&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;&lt;i&gt;&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;After doing the above steps the &lt;b&gt;Foreach Loop Editor&lt;/b&gt; should look as below.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-65-metablogapi/2626.clip_5F00_image005_5F00_2.jpg"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 5px 5px 5px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image005" border="0" alt="clip_image005" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-65-metablogapi/6232.clip_5F00_image005_5F00_thumb.jpg" width="340" height="309" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;4. In the &lt;b&gt;Foreach Loop Editor&lt;/b&gt; window select Variable Mappings tab and then click the drop down under Variable column and select &amp;lt;New Variable&amp;gt;. It will give you the “Add variable” screen.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-65-metablogapi/0066.clip_5F00_image008_5F00_2.jpg"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 5px 5px 5px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image008" border="0" alt="clip_image008" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-65-metablogapi/0572.clip_5F00_image008_5F00_thumb.jpg" width="343" height="318" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;5. In the “Add Variable” screen name the variable as “MyFile” and also select the other options as below.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-65-metablogapi/4188.clip_5F00_image011_5F00_2.jpg"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 5px 5px 5px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image011" border="0" alt="clip_image011" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-65-metablogapi/3108.clip_5F00_image011_5F00_thumb.jpg" width="333" height="289" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;6. Now click OK and you should see the variable “MyFile” added in the &lt;b&gt;Foreach Loop Container&lt;/b&gt; as below.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-65-metablogapi/8715.clip_5F00_image014_5F00_2.jpg"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 5px 5px 5px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image014" border="0" alt="clip_image014" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-65-metablogapi/3583.clip_5F00_image014_5F00_thumb.jpg" width="333" height="301" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;7. Clcik OK to the Foreach Loop Editor windows and then drag and drop a Script Task and place it inside the Foreach Loop Container.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-65-metablogapi/1537.clip_5F00_image016_5F00_2.jpg"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image016" border="0" alt="clip_image016" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-65-metablogapi/5353.clip_5F00_image016_5F00_thumb.jpg" width="244" height="107" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;8. From the top menu bar select SSISà Variable &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-65-metablogapi/3583.clip_5F00_image019_5F00_2.jpg"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 5px 5px 5px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image019" border="0" alt="clip_image019" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-65-metablogapi/7823.clip_5F00_image019_5F00_thumb.jpg" width="332" height="191" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;9. In the Variables pan you should already see the variable we added earlier “MyFile”. Type the name of another new variable “MyFiles” and select the other options as below.   &lt;table cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td width="232"&gt;           &lt;table cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;               &lt;tr&gt;                 &lt;td&gt;&amp;nbsp;&lt;/td&gt;               &lt;/tr&gt;             &lt;/tbody&gt;&lt;/table&gt;         &lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt;  &lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-65-metablogapi/4505.clip_5F00_image022_5F00_2.jpg"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image022" border="0" alt="clip_image022" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-65-metablogapi/3583.clip_5F00_image022_5F00_thumb.jpg" width="244" height="81" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;10. Double click the Script Task to get the Script Task Editor window and click the browse button next to “ReadOnlyVariables”.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-65-metablogapi/6327.clip_5F00_image025_5F00_2.jpg"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 5px 5px 5px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image025" border="0" alt="clip_image025" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-65-metablogapi/0385.clip_5F00_image025_5F00_thumb.jpg" width="354" height="328" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;11. Once you click the browse button in the Script Task Editor you will get the following Select Variables window.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-65-metablogapi/7801.clip_5F00_image028_5F00_2.jpg"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 5px 5px 5px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image028" border="0" alt="clip_image028" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-65-metablogapi/0535.clip_5F00_image028_5F00_thumb.jpg" width="364" height="266" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;12. Check the variable “MyFile” and then clcik OK&lt;/p&gt;  &lt;p&gt;13. Repeat steps 10 and 11 and select the variable “MyFiles” for the field “ReadWriteVariables”. After the selections the Script Task Editor should look as below.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-65-metablogapi/3107.clip_5F00_image032_5F00_2.jpg"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 5px 5px 5px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image032" border="0" alt="clip_image032" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-65-metablogapi/2117.clip_5F00_image032_5F00_thumb.jpg" width="358" height="331" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;14. Now form the Script Task Editor window click the “Edit Script” button and add the following code in the Main() function and the click OK to complete editing the Script Task.&lt;/p&gt;  &lt;p&gt;Note: The commented lines are for testing or debugging. I left them here in case you start to see issues and may need to debug J&lt;/p&gt;  &lt;p&gt;public void Main()&lt;/p&gt;  &lt;p&gt;{&lt;/p&gt;  &lt;p&gt;// TODO: Add your code here&lt;/p&gt;  &lt;p&gt;//Dts.Log(&amp;quot;entering SCRIPT TASK.. &amp;quot;, 999, null); &lt;/p&gt;  &lt;p&gt;Dts.Variables[&amp;quot;User::MyFiles&amp;quot;].Value = Dts.Variables[&amp;quot;User::MyFiles&amp;quot;].Value.ToString() + &amp;quot;|&amp;quot; + Dts.Variables[&amp;quot;User::MyFile&amp;quot;].Value.ToString();&lt;/p&gt;  &lt;p&gt;//MessageBox.Show(Dts.Variables[&amp;quot;User::MyFile&amp;quot;].Value.ToString());&lt;/p&gt;  &lt;p&gt;//MessageBox.Show(Dts.Variables[&amp;quot;User::MyFiles&amp;quot;].Value.ToString());&lt;/p&gt;  &lt;p&gt;Dts.TaskResult = (int)ScriptResults.Success;&lt;/p&gt;  &lt;p&gt;}&lt;/p&gt;  &lt;p&gt;So the Foreach loop will loop through the files in the specified folder and the script task will concatenate the file names in the “MyFiles” variable. Now we need to add a Send Email task and use the MyFiles variable to attach all the files.&lt;/p&gt;  &lt;p&gt;15. Before we can add a Send Email Task we need to add a SMTP connection manager. Right click under the Connection managers pan at the bottom and select “New Connection”   &lt;table cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td width="438"&gt;           &lt;table cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;               &lt;tr&gt;                 &lt;td&gt;&amp;nbsp;&lt;/td&gt;               &lt;/tr&gt;             &lt;/tbody&gt;&lt;/table&gt;         &lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt;   &lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-65-metablogapi/5241.clip_5F00_image034_5F00_2.jpg"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 5px 5px 5px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image034" border="0" alt="clip_image034" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-65-metablogapi/0042.clip_5F00_image034_5F00_thumb.jpg" width="358" height="375" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;16. From the Add SSIS Connection Manager windows select SMTP and click “Add” button. You should get the following SMTP Connection Manager Editor window.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-65-metablogapi/3000.clip_5F00_image039_5F00_2.jpg"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 5px 5px 5px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image039" border="0" alt="clip_image039" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-65-metablogapi/5734.clip_5F00_image039_5F00_thumb.jpg" width="347" height="251" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;17. Specify your SMTP server and make sure this is a valid SMTP server. You need to enable SMTP service in your machine. Click OK to complete the SMTP connection Manager configuration.&lt;/p&gt;  &lt;p&gt;18. Drag and drop a &lt;b&gt;Send Email Task&lt;/b&gt; outside &lt;b&gt;Foreach Loop Container&lt;/b&gt;.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-65-metablogapi/5340.clip_5F00_image041_5F00_2.jpg"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image041" border="0" alt="clip_image041" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-65-metablogapi/6724.clip_5F00_image041_5F00_thumb.jpg" width="244" height="211" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;19. Double click the &lt;b&gt;Send Email Task&lt;/b&gt; to get the &lt;b&gt;Send Email Task Editor&lt;/b&gt;. Select the newly created SMTP connection Manager form the dropdown. Type the &lt;b&gt;From&lt;/b&gt; email address and then type the email address of the recipients separated by semicolon in the &lt;b&gt;To&lt;/b&gt; filed. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-65-metablogapi/0066.clip_5F00_image044_5F00_2.jpg"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 5px 5px 5px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image044" border="0" alt="clip_image044" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-65-metablogapi/0844.clip_5F00_image044_5F00_thumb.jpg" width="381" height="357" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;20. Click the expression tab from the left and set the value of FileAttachments field under Expression as @[User::MyFiles]. This will attach all the files in the email that we looped though in the Foreach loop.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-65-metablogapi/4274.clip_5F00_image047_5F00_2.jpg"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 5px 5px 5px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image047" border="0" alt="clip_image047" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-65-metablogapi/2514.clip_5F00_image047_5F00_thumb.jpg" width="392" height="363" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;21. Click OK to complete the setting of the Send Email Task and run the package. &lt;/p&gt;  &lt;p&gt;Reference:&lt;/p&gt;  &lt;p&gt;Configure SMTP E-mail (IIS 7)&lt;/p&gt;  &lt;p&gt;&lt;a href="http://technet.microsoft.com/en-us/library/cc772058(WS.10).aspx"&gt;http://technet.microsoft.com/en-us/library/cc772058(WS.10).aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;i&gt;Note:&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;&lt;i&gt;The SMTP server is not installed by default. SMTP can be added through the &lt;strong&gt;Features Summary&lt;/strong&gt; area of the &lt;strong&gt;Server Manager&lt;/strong&gt; tool in Windows Server® 2008.&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;Send Mail Task&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms142165.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms142165.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;SMTP Connection Manager&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms137684.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms137684.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Author: MFarooq [MSFT]&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10174622" width="1" height="1"&gt;</description></item><item><title>.NET application doesn’t connect to the SQL server after a Database mirroring failover</title><link>http://blogs.msdn.com/b/sqlblog/archive/2011/06/14/net-application-doesn-t-connect-to-the-sql-server-after-a-database-mirroring-failover.aspx</link><pubDate>Wed, 15 Jun 2011 01:08:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10174618</guid><dc:creator>sqlblog</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/sqlblog/rsscomments.aspx?WeblogPostID=10174618</wfw:commentRss><comments>http://blogs.msdn.com/b/sqlblog/archive/2011/06/14/net-application-doesn-t-connect-to-the-sql-server-after-a-database-mirroring-failover.aspx#comments</comments><description>&lt;p&gt;In this blog I will discuss a connection timeout issue that one of my customers was having after failing over the mirror database. For better understanding of the issue let me discuss some key terms/concepts of database mirroring before I get into the issue description. Database mirroring is first introduced in SQL Server 2005 for increasing database availability. It is software solution and does not require any hardware like clustering. Database mirroring involves redoing every insert, update, and delete operation that occurs on the principal database onto the mirror database as quickly as possible. Redoing is accomplished by sending a stream of active transaction log records to the mirror server, which applies log records to the mirror database, in sequence, as quickly as possible. &lt;/p&gt;  &lt;p&gt;If a SQL server database is configured with a mirrored database and the principal database becomes unavailable for some reason then we can manually or automatically failover to the mirrored database. &lt;/p&gt;  &lt;p&gt;To support automatic failover, a database mirroring session must be configured in high-safety mode and also possess a third server instance, known as the &lt;i&gt;witness&lt;/i&gt;. To know more about how SQL server mirroring works please read the following MS links.&lt;/p&gt;  &lt;p&gt;Database Mirroring in SQL Server 2005&lt;/p&gt;  &lt;p&gt;&lt;a href="http://technet.microsoft.com/en-us/library/cc917680.aspx"&gt;http://technet.microsoft.com/en-us/library/cc917680.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;How to: Configure a Database Mirroring Session (SQL Server Management Studio)&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms188712.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms188712.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Now let’s get into the detail of the issue I want to discuss today. Customer was observing timeout error from the application after shutting down the principal server. They had setup the database mirroring as “high safety with automatic failover mirror” using a witness and were also specifying the Failover Partner and a connection timeout of 10 seconds in the connection string. During testing, when they turned off the SQL Server service on the principal server the auto failover worked like a charm, but when they took the principal server offline (by shutting down the server or killing the network card) failover happened as expected (i.e. the mirror becomes the new principal) but the application that was trying to connect to the SQL server mirrored database was getting a timeout error as below.&lt;/p&gt;  &lt;p&gt;Server Error in '/' Application.&lt;/p&gt;  &lt;p&gt;A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - The wait operation timed out.)&lt;/p&gt;  &lt;p&gt;Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. &lt;/p&gt;  &lt;p&gt;Exception Details: System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - The wait operation timed out.)&lt;/p&gt;  &lt;p&gt;So once again the problem is if they stop only the SQL server service mirroring works as expected but when they shut down the SQL Server (principal) the connections were timing out and the application was not able to connect to the mirrored database as expected. &lt;/p&gt;  &lt;p&gt;Without digging into this further we requested the customer to increase the connection time out to 60 seconds and test. Customer increased the connections time and now even after shutting down the SQL server the application was able to connection to the mirrored database successfully.&lt;/p&gt;  &lt;p&gt;So we were able to find a work around for the issue pretty quick but we still needed to explain what was causing the issue and why increasing the connection timeout fixed it. To find out the reason behind these different behaviors we captured network traces in all three scenarios.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Scenario 1: We did a failover from the principle to the mirror by only stopping the SQL server service. In this scenario the application was able to connect to the mirror database successfully.&lt;/b&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;1. To initiate a connection the client sends SYN&amp;#160; to the principal and the principle server sends ACK, RST right away&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-65-metablogapi/7416.clip_5F00_image002_5F00_2.jpg"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 5px 5px 5px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image002" border="0" alt="clip_image002" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-65-metablogapi/1856.clip_5F00_image002_5F00_thumb.jpg" width="535" height="65" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;2. As the client gets the response from the principle almost immediately it tries to connect to the mirror and the connection becomes successful.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-65-metablogapi/2538.clip_5F00_image004_5F00_2.jpg"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image004" border="0" alt="clip_image004" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-65-metablogapi/5353.clip_5F00_image004_5F00_thumb.jpg" width="664" height="86" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Scenario 2: We did a failover by shutting down the principal server and the connection timeout was set to 10 sec. In this scenario the application was failing to connect to the SQL server and displaying a timeout error.&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;1. To initiate a connection client sends SYN to the principal and it gets nothing back from the principle as the principle is not up.&lt;/p&gt;  &lt;p&gt;2. So the client retransmits the SYN to the principle based on the value in TcpMaxConnectRetransmissions registry key. TcpMaxConnectRetransmissions specifies how many times TCP retransmits an unanswered request for a new connection. TCP retransmits new connection requests until they are answered or until this value expires. The default value of TcpMaxConnectRetransmissions is 2.&lt;/p&gt;  &lt;p&gt;TCP/IP adjusts the frequency of retransmissions over time. The delay between the original transmission and the first retransmission for each interface is determined by the value of the &lt;strong&gt;TcpInitialRTT&lt;/strong&gt; entry. By default, it is three seconds. This delay doubles after each attempt. After the final attempt, TCP/IP waits for an interval equal to double the last delay, and then it abandons the connection request.&lt;/p&gt;  &lt;p&gt;Please keep in mind that TcpMaxConnectRetransmissions is different from TcpMaxDataRetransmissions which specifies how many times TCP retransmits an unacknowledged data segment on an existing connection. &lt;/p&gt;  &lt;p&gt;In the network trace we see the application server retransmitted SYN after 3 seconds. TcpMaxConnectRetransmissions was set to two so the next retransmit should be after 6 more seconds and 3+6= 9 sec from the beginning of the connection and after that we should wait another 6*2=12 seconds before trying to connect to the mirror database. Customer set the connection timeout as 10 seconds. For some reason I did not see the 2&lt;sup&gt;nd&lt;/sup&gt; retransmit packet in the trace but regardless the connection was timed out. We did not see any attempt in the trace to make a connation to the mirror database. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-65-metablogapi/4188.clip_5F00_image006_5F00_2.jpg"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 5px 5px 5px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image006" border="0" alt="clip_image006" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-65-metablogapi/7823.clip_5F00_image006_5F00_thumb.jpg" width="716" height="66" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Scenario 3: We did a failover by shutting down the principal database but the connection timeout in the connection string was increased from 10 seconds to 60 seconds. In this scenario the application was able to connect to the mirror database successfully.&lt;/b&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;1. To initiate a connection client sends SYN to principal and it gets nothing back from the principle as the principle is not up.&lt;/font&gt;&lt;/p&gt;  &lt;h4&gt;&lt;font style="font-weight: normal" size="2"&gt;2. So client retransmits the SYN to the principle after 3 seconds. The default value for TcpMaxConnectRetransmissions is set to 2. It should retransmits the SYN after 6 more seconds. Then it should wait for another 6*2=12 sec and then try to connect to the mirror database. &lt;/font&gt;&lt;/h4&gt;  &lt;h4&gt;&lt;font size="2"&gt;&lt;font style="font-weight: normal"&gt;3. For some reason we are not seeing the 2&lt;/font&gt;&lt;sup&gt;&lt;font style="font-weight: normal"&gt;nd&lt;/font&gt;&lt;/sup&gt;&lt;/font&gt;&lt;font style="font-weight: normal"&gt;&lt;font size="2"&gt; retransmits the SYN from the app server to the principal in the trace. However, we as expected exactly after 6+12=18 sec the app server sent SYN to the mirror server to initiate the connection. It got response right away and the connection was successful. From the beginning it took total 3+6+12=21 secs to attempt to connect to the mirror database which is less than the new connection timeout value 60 seconds and this why we did not see any connection timeout this time.&lt;/font&gt; &lt;/font&gt;&lt;/h4&gt;  &lt;h4&gt;&lt;/h4&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-65-metablogapi/5153.clip_5F00_image008_5F00_2.jpg"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 5px 5px 5px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image008" border="0" alt="clip_image008" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-65-metablogapi/6242.clip_5F00_image008_5F00_thumb.jpg" width="692" height="116" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;To recap in the first scenario we did not see a timeout because even though the SQL server service was stopped the server was up and sent a RESET to the client right away and the application server was able to establish a connection with the mirror database before connection timeout 10 seconds. In the second scenario we were getting the timeout because the principal server was shutdown and therefore the application server was not getting any response at all from the SQL server and had to do 2 retransmits based on the default TcpMaxConnectRetransmissions value before it could try to connect to the mirror database. The connection timeout value was too and small (10 sec) and it timed out while doing those retransmits to the principal server and never had a chance to try to connect to the mirror database.&lt;/p&gt;  &lt;p&gt;In the 3&lt;sup&gt;rd&lt;/sup&gt; scenario as we increased the connection timeout the application server was able to try to connect to the mirror database after done retransmitting the SYN packets to the principal server and the connection was successful.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;References:&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;How to: Configure a Database Mirroring Session (SQL Server Management Studio)&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms188712.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms188712.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Making the Initial Connection to a Database Mirroring Session&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms366348.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms366348.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Connection Retry Algorithm (for TCP/IP Connections)&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms365783.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms365783.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;TcpMaxConnectRetransmissions&lt;/p&gt;  &lt;p&gt;&lt;a href="http://technet.microsoft.com/en-us/library/cc758896(WS.10).aspx"&gt;http://technet.microsoft.com/en-us/library/cc758896(WS.10).aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;TcpMaxDataRetransmissions&lt;/p&gt;  &lt;p&gt;&lt;a href="http://technet.microsoft.com/en-us/library/cc780586(WS.10).aspx"&gt;http://technet.microsoft.com/en-us/library/cc780586(WS.10).aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Author: MFarooq [MSFT]&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10174618" width="1" height="1"&gt;</description></item><item><title>App using SQLClient(.NET 4.0) will automatically construct an SPN when using shared memory with windows authentication</title><link>http://blogs.msdn.com/b/sqlblog/archive/2011/05/25/app-using-sqlclient-net-4-0-will-automatically-construct-an-spn-when-using-shared-memory-with-windows-authentication.aspx</link><pubDate>Wed, 25 May 2011 22:40:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10168440</guid><dc:creator>sqlblog</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/sqlblog/rsscomments.aspx?WeblogPostID=10168440</wfw:commentRss><comments>http://blogs.msdn.com/b/sqlblog/archive/2011/05/25/app-using-sqlclient-net-4-0-will-automatically-construct-an-spn-when-using-shared-memory-with-windows-authentication.aspx#comments</comments><description>&lt;p&gt;Consider the following scenario:&lt;/p&gt;  &lt;p&gt;1) You have a .NET 4.0 application connecting to SQL Server 2005 or SQL Server 2008 edition (including SQL Server Express Edition) with ADO.NET using SQLClient provider.&lt;/p&gt;  &lt;p&gt;2) Only Shared Memory is enabled for protocols for SQL Server Instance&lt;/p&gt;  &lt;p&gt;3) All client protocols are enabled for SQL Native Client and SQL Native Client 10.0.&lt;/p&gt;  &lt;p&gt;4) The application is running on Windows 7 machine.&lt;/p&gt;  &lt;p&gt;In this scenario, the application may fail to connect to SQL Server, with the following error message:&lt;/p&gt;  &lt;p&gt;Login failed. The login is from an untrusted domain and cannot be used with Windows authentication. [CLIENT: &amp;lt;local machine&amp;gt;]&lt;/p&gt;  &lt;p&gt;Additionally, you may also see the following error message in the application event log:&lt;/p&gt;  &lt;p&gt;SSPI handshake failed with error code 0x8009030c, state 14 while establishing a connection with integrated security; the connection has been closed. Reason: AcceptSecurityContext failed. The Windows error code indicates the cause of failure. [CLIENT: &amp;lt;local machine&amp;gt;].&lt;/p&gt;  &lt;p&gt;At a first look, it may seem that the issue is related to Kerberos, because we see most of the SSPI handshake error messages due to Kerberos failure, which would most likely be related to non-existent SPN or bad SPN for SQL Server. We would expect that, for local connections, we are connecting over NTLM and the SPN is not required for NTLM.&lt;/p&gt;  &lt;p&gt;A reference discussion on the error “SSPI handshake failed with error code 0x8009030c” can be found in this forum post: &lt;a href="http://social.msdn.microsoft.com/Forums/en-US/sqlsecurity/thread/c46b0257-7304-47dc-a8b5-090001ff70a5"&gt;http://social.msdn.microsoft.com/Forums/en-US/sqlsecurity/thread/c46b0257-7304-47dc-a8b5-090001ff70a5&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;While I will discuss on how we can resolve the “Login failed” issue, the main goal for this blog is to point out that, there is a breaking change in ADO.NET SQLClient provider implementation of .NET 4.0. SQLClient in a .NET 4.0 Application will automatically construct an SPN for SQL Server connections over shared memory when windows authentication is used. In the prior version, .NET 3.5 SP1, this was not the case, for connections, we would use NTLM directly. To comply with NTLM Reflection Protection and to Extended Protection improvements in Windows Security, we now use the Negotiate SSP ( &lt;a href="http://msdn.microsoft.com/en-us/library/aa378748(VS.85).aspx"&gt;http://msdn.microsoft.com/en-us/library/aa378748(VS.85).aspx &lt;/a&gt;), rather than directly using NTLM, in addition to constructing an SPN for the SQL Server we connect to locally from the ADO.NET Applications. Authentication defaults will be as detailed in the MSDN Article &lt;a href="http://msdn.microsoft.com/en-us/library/ms191153.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms191153.aspx under &amp;quot;Authenticaion Defaults&amp;quot; section. &lt;/a&gt;&lt;/p&gt;  &lt;p&gt;In the above scenario, the reason of the “Login Failed” error message was due to the fact that, when attempting a local connection over shared memory, SQLClient was constructing an SPN for NTLM authentication, for the reasons explained above. Due to the DNS resolution, the constructed SPN became different (we were getting a wrong suffix) than the SPN that is present in domain controller.&lt;/p&gt;  &lt;p&gt;While the correct DNS resolution is required to fix the issue (so we can construct the correct SPN), to work around the issue, we can use one of the following methods:&lt;/p&gt;  &lt;p&gt;1) Create a named pipe alias for the SQL Server you are connecting to using SQL Native client 10.&lt;/p&gt;  &lt;p&gt;2) Change the registry key as per KB, to include &amp;quot;&lt;b&gt; BackConnectionHostNames&lt;/b&gt; &amp;quot;, Method 1 on the KB: &lt;a href="http://support.microsoft.com/kb/926642"&gt;http://support.microsoft.com/kb/926642&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Method 1 (recommended): Create the Local Security Authority host names that can be referenced in an NTLM authentication request&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;To do this, follow these steps for all the nodes on the client computer: &lt;/p&gt;  &lt;p&gt;1. Click &lt;b&gt;Start&lt;/b&gt;, click &lt;b&gt;Run&lt;/b&gt;, type &lt;b&gt;regedit&lt;/b&gt;, and then click &lt;b&gt;OK&lt;/b&gt;. &lt;/p&gt;  &lt;p&gt;2. Locate and then click the following registry subkey: &lt;b&gt;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;3. Right-click &lt;b&gt;MSV1_0&lt;/b&gt;, point to &lt;b&gt;New&lt;/b&gt;, and then click &lt;b&gt;Multi-String Value&lt;/b&gt;. &lt;/p&gt;  &lt;p&gt;4. In the &lt;b&gt;Name&lt;/b&gt; column, type &lt;b&gt;BackConnectionHostNames&lt;/b&gt;, and then press ENTER. &lt;/p&gt;  &lt;p&gt;5. Right-click &lt;b&gt;BackConnectionHostNames&lt;/b&gt;, and then click &lt;b&gt;Modify&lt;/b&gt;. &lt;/p&gt;  &lt;p&gt;6. In the &lt;b&gt;Value&lt;/b&gt; data box, type the CNAME or the DNS alias, that is used for the local shares on the computer, and then click &lt;b&gt;OK&lt;/b&gt;.    &lt;br /&gt;&lt;b&gt;Note &lt;/b&gt;Type each host name on a separate line.    &lt;br /&gt;&lt;b&gt;Note &lt;/b&gt;If the BackConnectionHostNames registry entry exists as a REG_DWORD type, you have to delete the BackConnectionHostNames registry entry. &lt;/p&gt;  &lt;p&gt;7. Exit Registry Editor, and then restart the computer.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;MORE INFORMATION&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Registering a Service Principal Name    &lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms191153.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms191153.aspx &lt;/a&gt;    &lt;br /&gt;Service Principal Name (SPN) Support in Client Connections     &lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/cc280459(v=SQL.105).aspx"&gt;http://msdn.microsoft.com/en-us/library/cc280459(v=SQL.105).aspx &lt;/a&gt;    &lt;br /&gt;What SPN do I use and how does it get there?     &lt;br /&gt;&lt;a href="http://blogs.msdn.com/b/psssql/archive/2010/03/09/what-spn-do-i-use-and-how-does-it-get-there.aspx"&gt;http://blogs.msdn.com/b/psssql/archive/2010/03/09/what-spn-do-i-use-and-how-does-it-get-there.aspx &lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Error message when you try to access a server locally by using its FQDN or its CNAME alias after you install Windows Server 2003 Service Pack 1: &amp;quot;Access denied&amp;quot; or &amp;quot;No network provider accepted the given network path&amp;quot;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://support.microsoft.com/kb/926642"&gt;http://support.microsoft.com/kb/926642&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Understanding Kerberos and NTLM authentication in SQL Server Connections&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/b/sql_protocols/archive/2006/12/02/understanding-kerberos-and-ntlm-authentication-in-sql-server-connections.aspx"&gt;http://blogs.msdn.com/b/sql_protocols/archive/2006/12/02/understanding-kerberos-and-ntlm-authentication-in-sql-server-connections.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Understanding the error message: “Login failed for user ''. The user is not associated with a trusted SQL Server connection.”&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/b/sql_protocols/archive/2008/05/03/understanding-the-error-message-login-failed-for-user-the-user-is-not-associated-with-a-trusted-sql-server-connection.aspx"&gt;&lt;b&gt;http://blogs.msdn.com/b/sql_protocols/archive/2008/05/03/understanding-the-error-message-login-failed-for-user-the-user-is-not-associated-with-a-trusted-sql-server-connection.aspx&lt;/b&gt;&lt;/a&gt;&lt;b&gt; &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Author : Meer(MSFT), SQL Developer Escalation Services , Microsoft &lt;/p&gt;  &lt;p&gt;Posted by : Enamul(MSFT), SQL Developer Technical Lead , Microsoft&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10168440" width="1" height="1"&gt;</description></item><item><title>ADO.NET application connecting to a mirrored SQL Server Database may timeout long before the actual connection timeout elapses, sometimes within milliseconds</title><link>http://blogs.msdn.com/b/sqlblog/archive/2011/05/25/ado-net-application-connecting-to-a-mirrored-sql-server-database-may-timeout-long-before-the-actual-connection-timeout-elapses-sometimes-within-milliseconds.aspx</link><pubDate>Wed, 25 May 2011 22:35:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10168439</guid><dc:creator>sqlblog</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/sqlblog/rsscomments.aspx?WeblogPostID=10168439</wfw:commentRss><comments>http://blogs.msdn.com/b/sqlblog/archive/2011/05/25/ado-net-application-connecting-to-a-mirrored-sql-server-database-may-timeout-long-before-the-actual-connection-timeout-elapses-sometimes-within-milliseconds.aspx#comments</comments><description>&lt;p&gt;Recently we had few cases, where .NET Applications, connecting to a mirrored SQL Server Database, using ADO.NET SQLClient provider, in a mirrored SQL Server 2005 or SQL Server 2008 instance scenario, may intermittently fail with the following error message:&lt;/p&gt;  &lt;p&gt;System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.&lt;/p&gt;  &lt;p&gt;at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)&lt;/p&gt;  &lt;p&gt;at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)&lt;/p&gt;  &lt;p&gt;at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)&lt;/p&gt;  &lt;p&gt;at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)&lt;/p&gt;  &lt;p&gt;at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)&lt;/p&gt;  &lt;p&gt;at System.Data.SqlClient.SqlConnection.Open()&lt;/p&gt;  &lt;p&gt;A more detail call stack, as we reproduced the issue, will look like the following stack:&lt;/p&gt;  &lt;p&gt;Timeout expired.&amp;#160; The timeout period elapsed prior to completion of the operation or the server is not responding.&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160; at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160; at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160; at System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj, UInt32 error)&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160; at System.Data.SqlClient.TdsParserStateObject.ReadSni(DbAsyncResult asyncResult, TdsParserStateObject stateObj)&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160; at System.Data.SqlClient.TdsParserStateObject.ReadNetworkPacket()&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160; at System.Data.SqlClient.TdsParser.ConsumePreLoginHandshake(Boolean encrypt, Boolean trustServerCert, Boolean&amp;amp; marsCapable)&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160; at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Bo&lt;/p&gt;  &lt;p&gt;olean integratedSecurity)&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160; at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, SqlConnection owningObject)&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160; at System.Data.SqlClient.SqlInternalConnectionTds.LoginWithFailover(Boolean useFailoverHost, ServerInfo primaryServerInfo, String failoverHost, String newPassword, Boolean redirectedUserInstance, S&lt;/p&gt;  &lt;p&gt;qlConnection owningObject, SqlConnectionString connectionOptions, TimeoutTimer timeout)&lt;/p&gt;  &lt;p&gt;What make this timeout interesting is that the applications experience the connection timeout long before the actual default connection timeout value (15s), sometimes in milliseconds.&lt;/p&gt;  &lt;p&gt;The issue happens, because, SQLClient uses the &lt;a href="http://msdn.microsoft.com/en-us/library/ms365783.aspx"&gt;connection retry algorithm (for TCP/IP Connections)&lt;/a&gt;, and sets the initial connection timeout value as 15*0.08~1200ms and first tries to connect to the principal SQL server and if fails, then, tries to connect to mirrored SQL Server (the fact that the database is mirrored, may come from the connection string or SQLClient may collect this information, the first time it connects to the database). If this connection attempt also fails due to timeout (because of slow response from SQL Server or due to network delays), the SQLClient incorrectly sets the connection to doomed state, giving the connection timeout exception, without further connection retry attempt to principal.&lt;/p&gt;  &lt;p&gt;Microsoft has confirmed that this is a problem in the current release of ADO.NET. This issue will be fixed in ADO.NET version, ships with Visual Studio 2011.&lt;/p&gt;  &lt;p&gt;In the meantime, we request to use the following workarounds:&lt;/p&gt;  &lt;p&gt;1. Increase the connection string timeout to 150 sec. This will give the first attempt enough time to connect( 150* .08=12 sec)&lt;/p&gt;  &lt;p&gt;2. Add MinPool Size=20 in the connection string. This will always maintain a minimum of 20 connections in the pool and there will be less chances of creating new connection, thus reducing the chance of this error.&lt;/p&gt;  &lt;p&gt;3. Improve the network performance. Update your NIC drivers to the latest firmware version. We have seen network latency when your NIC card is not compatible with certain &lt;a href="http://support.microsoft.com/kb/912222"&gt;Scalable Networking Pack&lt;/a&gt; settings. If you are on Windows Vista SP1 or above you may also consider disabling &lt;a href="http://support.microsoft.com/kb/947239"&gt;Receive Window Auto-Tuning&lt;/a&gt;. If you have NIC teaming enabled, disabling it would be a good option.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Author : Meer(MSFT), SQL Developer Escalation Services , Microsoft &lt;/p&gt;  &lt;p&gt;Posted by : Enamul(MSFT), SQL Developer Technical Lead , Microsoft&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10168439" width="1" height="1"&gt;</description></item><item><title>Executing an INSERT statement on a View in linked server</title><link>http://blogs.msdn.com/b/sqlblog/archive/2011/02/22/executing-an-insert-statement-on-a-view-in-linked-server.aspx</link><pubDate>Tue, 22 Feb 2011 18:50:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10132791</guid><dc:creator>sqlblog</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/sqlblog/rsscomments.aspx?WeblogPostID=10132791</wfw:commentRss><comments>http://blogs.msdn.com/b/sqlblog/archive/2011/02/22/executing-an-insert-statement-on-a-view-in-linked-server.aspx#comments</comments><description>&lt;p&gt;Consider this scenario where you have a linked server from one SQL server to another SQL Server. Both the SQL Servers are SQL Server 2008 SP2 on Windows 2008.&lt;/p&gt;  &lt;p&gt;Say the two SQL Servers are Server A and Server B.&lt;/p&gt;  &lt;p&gt;Linked server from Server A to Server B is set up using SQL Native Client 10.0 provider.&lt;/p&gt;  &lt;p&gt;On Server B, you have a VIEW that joins couple of tables, TABLE 1 and TABLE2 and a trigger that fires an INSERT into Table 2 when you INSERT into the View.&lt;/p&gt;  &lt;p&gt;SERVER B&lt;/p&gt;  &lt;p&gt;---------------------&lt;/p&gt;  &lt;p&gt;Create 2 tables, 1 view, 1 trigger (instead of)&lt;/p&gt;  &lt;p&gt;CREATE TABLE T1 (c1 INT)&lt;/p&gt;  &lt;p&gt;GO&lt;/p&gt;  &lt;p&gt;CREATE TABLE T2 (c2 INT)&lt;/p&gt;  &lt;p&gt;GO&lt;/p&gt;  &lt;p&gt;CREATE VIEW vt (cv) AS SELECT c1 FROM t1 UNION ALL SELECT c2 FROM t2&lt;/p&gt;  &lt;p&gt;GO&lt;/p&gt;  &lt;p&gt;The View confirms to the rules of an Updateable View and a Partitioned View&lt;/p&gt;  &lt;p&gt;&lt;b&gt;CREATE VIEW&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms187956.aspx"&gt;&lt;b&gt;http://msdn.microsoft.com/en-us/library/ms187956.aspx&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Create an INSTEAD OF TRIGGER to INSERT into physical table t2 when insert is fired against the VIEW.&lt;/p&gt;  &lt;p&gt;CREATE TRIGGER vt_trig ON vt INSTEAD OF INSERT AS&lt;/p&gt;  &lt;p&gt;BEGIN&lt;/p&gt;  &lt;p&gt;INSERT INTO t2 (c2) SELECT i.cv FROM INSERTED i&lt;/p&gt;  &lt;p&gt;END&lt;/p&gt;  &lt;p&gt;SERVER A&lt;/p&gt;  &lt;p&gt;---------------------&lt;/p&gt;  &lt;p&gt;Create linked server on Server A to Server B with default SNAC provider and call it SNACLinked. Also create another linked server with MSDASQL and ODBC DSN (set up ODBC DSN using SQLODBCsrv driver) and call it MSDASQL_SQL2008.&lt;/p&gt;  &lt;p&gt;Set up linked server with MSDASQL and SQLODBC driver instead of SQLNCLI provider:&lt;/p&gt;  &lt;p&gt;EXEC sp_addlinkedserver    &lt;br /&gt;@server = N'MSDASQL_SQL2008',     &lt;br /&gt;@srvproduct = N'',     &lt;br /&gt;@provider = N'MSDASQL',     &lt;br /&gt;@datasrc = N'sql2008' &amp;lt;- name of odbc system DSN&lt;/p&gt;  &lt;p&gt;In this linked server, this will work:    &lt;br /&gt;INSERT INTO MSDASQL_SQL2008.INST4.dbo.vt (cv) VALUES (111)&lt;/p&gt;  &lt;p&gt;When you INSERT into VIEW on Server A, using linked server created with SNAC, we get the below mentioned error:&lt;/p&gt;  &lt;p&gt;INSERT INTO SNACLinked.Test.dbo.vt(cv) values ('16')&lt;/p&gt;  &lt;p&gt;&lt;b&gt;ERROR:&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;OLE DB provider &amp;quot;SQLNCLI10&amp;quot; for linked server &amp;quot;XXXX&amp;quot; returned message &amp;quot;Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.&amp;quot;&lt;/p&gt;  &lt;p&gt;Msg 16955, Level 16, State 2, Line 1&lt;/p&gt;  &lt;p&gt;Could not create an acceptable cursor.&lt;/p&gt;  &lt;p&gt;Locally executing the INSERT on VIEW on Server A works fine.&lt;/p&gt;  &lt;p&gt;INSERT into Test.dbo.vt(cv) values (9) – this executes fine.&lt;/p&gt;  &lt;p&gt;But when using ODBC DSN for linked server, the INSERT on VIEW works fine from Server A also:&lt;/p&gt;  &lt;p&gt;INSERT INTO MSDASQL_SQL2008.Test.dbo.vt(cv) values ('15') - works fine.&lt;/p&gt;  &lt;p&gt;The behavior is the same when you execute INSERT statement with OPENQUERY. It fails with the SNAC linked server but works fine with ODBC DSN linked server.&lt;/p&gt;  &lt;p&gt;INSERT OPENQUERY (SNACLinked, 'SELECT CV FROM TEST.dbo.vt')&lt;/p&gt;  &lt;p&gt;VALUES ('16'); -- fails&lt;/p&gt;  &lt;p&gt;INSERT OPENQUERY (MSDASQL_SQL2008, 'SELECT CV FROM TEST.dbo.vt')&lt;/p&gt;  &lt;p&gt;VALUES ('16'); -- works fine&lt;/p&gt;  &lt;p&gt;It would still fail with the same error when an INDEXED VIEW with a separate TRIGGER is created in place of INSTEAD OF TRIGGER.&lt;/p&gt;  &lt;p&gt;CREATE VIEW vt_indexed (cvindexed) with SchemaBinding AS&lt;/p&gt;  &lt;p&gt;SELECT c1 FROM dbo.t1 UNION ALL SELECT c2 FROM dbo.t2&lt;/p&gt;  &lt;p&gt;GO&lt;/p&gt;  &lt;p&gt;CREATE TRIGGER vt_indexed_trig ON vt_indexed INSTEAD OF INSERT AS&lt;/p&gt;  &lt;p&gt;BEGIN&lt;/p&gt;  &lt;p&gt;INSERT INTO t2 (c2) SELECT i.cvindexed FROM INSERTED i&lt;/p&gt;  &lt;p&gt;END&lt;/p&gt;  &lt;p&gt;The XACT_ABORT SET option is set to ON for INSERT.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Why INSERT on VIEW with SQLNCLI fails&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;-------------------------------------------------------&lt;/p&gt;  &lt;p&gt;SQL Server wants to do a rowset-based INSERT (cursor based INSERT) operation through the OLE DB API IRowsetChange interface.&lt;/p&gt;  &lt;p&gt;SQL Server requests an Updateable rowset for the SELECT statement.&lt;/p&gt;  &lt;p&gt;In the SQLNCLI case we are going directly to the OLE DB provider (SQLNCLI or SQLNCLI10).&lt;/p&gt;  &lt;p&gt;In the SQLNCLI / OLE DB case we are getting a READ-ONLY cursor that just returns an error about the cursor and does not proceed further. The SQL engine cannot handle this scenario and throws an error.&lt;/p&gt;  &lt;p&gt;In the ODBC case, we are really going through MSDASQL/ODBC Driver of 2 layers that interact with SQL Engine. In the ODBC case the cursor gets downgraded to a read-only cursor (you can see the message in in the Profiler, The cursor was not declared). However, MSDASQL has additional logic here to simulate an updateable cursor. It indicates to the SQL Engine that an Updateable rowset is returned. SQL Engine can continue with its logic.&lt;/p&gt;  &lt;p&gt;Here is the Error message in Profiler:&lt;/p&gt;  &lt;p&gt;Exception Error: 16955, Severity: 16, State: 2 Microsoft SQL Server test 2396 55 2011-02-15 07:35:59.663&lt;/p&gt;  &lt;p&gt;User Error Message Could not create an acceptable cursor. Microsoft SQL Server test 2396 55 2011-02-15 07:35:59.663&lt;/p&gt;  &lt;p&gt;Exception Error: 16945, Severity: 16, State: 2 Microsoft SQL Server test 2396 55 2011-02-15 07:35:59.663&lt;/p&gt;  &lt;p&gt;User Error Message The cursor was not declared. Microsoft SQL Server test 2396 55 2011-02-15 07:35:59.663&lt;/p&gt;  &lt;p&gt;Continuing with only the MSDASQL case, SQL Engine does a positioned update through IRowsetChange::InsertRow. MSDASQL generates an INSERT statement as a response to this by parsing the base table/view name, e.g. INSERT INTO Test.dbo.vt( c1) VALUES(?). Since there is a trigger on this read-only VIEW, SQL engine handles it by executing the trigger and everything works.&lt;/p&gt;  &lt;p&gt;When opening an updateable rowset over a simple VIEW with a UNION, Rowsetviewer tries 2 things:&lt;/p&gt;  &lt;p&gt;declare @p1 int&lt;/p&gt;  &lt;p&gt;set @p1=0&lt;/p&gt;  &lt;p&gt;declare @p3 int&lt;/p&gt;  &lt;p&gt;set @p3=98305&lt;/p&gt;  &lt;p&gt;declare @p4 int&lt;/p&gt;  &lt;p&gt;set @p4=311300&lt;/p&gt;  &lt;p&gt;declare @p5 int&lt;/p&gt;  &lt;p&gt;set @p5=0&lt;/p&gt;  &lt;p&gt;exec sp_cursoropen @p1 output,N'select * from vt',@p3 output,@p4 output,@p5 output&lt;/p&gt;  &lt;p&gt;select @p1, @p3, @p4, @p5&lt;/p&gt;  &lt;p&gt;go&lt;/p&gt;  &lt;p&gt;declare @p1 int&lt;/p&gt;  &lt;p&gt;set @p1=180150009&lt;/p&gt;  &lt;p&gt;declare @p3 int&lt;/p&gt;  &lt;p&gt;set @p3=8&lt;/p&gt;  &lt;p&gt;declare @p4 int&lt;/p&gt;  &lt;p&gt;set @p4=1&lt;/p&gt;  &lt;p&gt;declare @p5 int&lt;/p&gt;  &lt;p&gt;set @p5=1&lt;/p&gt;  &lt;p&gt;exec sp_cursoropen @p1 output,N'select * from vt',@p3 output,@p4 output,@p5 output&lt;/p&gt;  &lt;p&gt;select @p1, @p3, @p4, @p5&lt;/p&gt;  &lt;p&gt;go&lt;/p&gt;  &lt;p&gt;Case1, which fails:&lt;/p&gt;  &lt;p&gt;scrollopt: 0x18001 = KEYSET_ACCEPTABLE, CHECK_ACCEPTED_TYPES, KEYSET&lt;/p&gt;  &lt;p&gt;ccopt: 0x4C004 = OPTIMISTIC_ACCEPTABLE,UPDT_IN_PLACE, CHECK_ACCEPTED_OTPS, OPTIMISTIC&lt;/p&gt;  &lt;p&gt;Case2 which succeeds:&lt;/p&gt;  &lt;p&gt;scrollopt: 8 = FORWARD_ONLY&lt;/p&gt;  &lt;p&gt;ccopt: 1 = READ_ONLY&lt;/p&gt;  &lt;p&gt;So in short:&lt;/p&gt;  &lt;p&gt;- SQL Server requests an updateable cursor&lt;/p&gt;  &lt;p&gt;- For most views, that fails&lt;/p&gt;  &lt;p&gt;- MSDASQL is simulating an updateable cursor with insert statements.&lt;/p&gt;  &lt;p&gt;So the workaround for SQLNCLI would be to use a stored procedure executed remotely:&lt;/p&gt;  &lt;p&gt;CREATE PROCEDURE [dbo].[UpdateViewStoredProc] @Param1 int&lt;/p&gt;  &lt;p&gt;AS&lt;/p&gt;  &lt;p&gt;BEGIN&lt;/p&gt;  &lt;p&gt;SET NOCOUNT ON;&lt;/p&gt;  &lt;p&gt;INSERT into Test.dbo.vt(cv) values (@Param1)&lt;/p&gt;  &lt;p&gt;END&lt;/p&gt;  &lt;p&gt;Execute this stored procedure from remote linked server:&lt;/p&gt;  &lt;p&gt;exec SNACLinked.Test.dbo.UpdateViewStoredProc 22&lt;/p&gt;  &lt;p&gt;References&lt;/p&gt;  &lt;p&gt;----------------&lt;/p&gt;  &lt;p&gt;CREATE VIEW&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms187956.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms187956.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;sp_cursoropen (Transact-SQL)&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ff848737.aspx"&gt;http://msdn.microsoft.com/en-us/library/ff848737.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Author: Aruna Koppanur (MSFT), SQL Developer Engineer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10132791" width="1" height="1"&gt;</description></item><item><title>No Books Online Content “in the box”  for the next version of SQL Server– Denali</title><link>http://blogs.msdn.com/b/sqlblog/archive/2011/02/03/no-books-online-content-in-the-box-for-the-next-version-of-sql-server-denali.aspx</link><pubDate>Thu, 03 Feb 2011 20:28:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10124539</guid><dc:creator>sqlblog</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/sqlblog/rsscomments.aspx?WeblogPostID=10124539</wfw:commentRss><comments>http://blogs.msdn.com/b/sqlblog/archive/2011/02/03/no-books-online-content-in-the-box-for-the-next-version-of-sql-server-denali.aspx#comments</comments><description>&lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The Denali discs will not contain any of the Books Online content; setup only installs the help viewer and a handful of utility .chm files. All of the BOL documentation will by default come from online (MSDN). With the Microsoft strategy moving to the cloud we want to use the internet as the centre of gravity for product documentation. This encourages customers to download the latest version when they install instead of installing stale content from disk that was locked down several months before general availability. We are one of the last few big Microsoft products shift to the online model for content delivery. &lt;/p&gt;  &lt;p&gt;Here’s some more information:&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Q: Does this mean no more local BOL?&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;A: You can access BOL locally. On first use of Help, the user is presented with a dialog asking them to choose either online or offline mode as the default setting for Help Viewer. By selecting “Yes,” the viewer will be configured to run in Online mode against the copy of BOL in the MSDN Library. If you select “No,” local mode is made the default setting and you will then need to download the Help packages containing Books Online by selecting “Install content from online” in Help Library Manager.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Q: How do I get BOL locally if I don’t have internet access (such as a data centre)?&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;A: A CAB of the BOL content is available on the Microsoft Download Centre that can be downloaded from a location that has internet access and can be burnt to disc, copied to a portable drive, or a network share.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Q: I have my Books Online on a network share, how do others access it now?&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Users simply need to go to Start &amp;gt;&amp;gt; All Programs &amp;gt;&amp;gt; Microsoft SQL Server “Denali” &amp;gt;&amp;gt; Help and Community and click on the “Manage Help Settings” shortcut. This launches Help Library Manager and from there users click the “Install content from disc” link, browse to the network share with the BOL CABs, select the HelpContentSetup.msha file, select Books Online in the list of content available for install, then click update. This will install the BOL content locally on the user’s machine.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;i&gt;Q: Why are you doing this again?&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;A:&amp;#160; Switching to an online solution provides more flexibility in providing customers with the most up-to-date content as we are no longer tied to the SQL Server release schedule.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;New customers typically first go through the BOL on the disc after installing SQL Server, so they keep referring to increasingly outdated content. We have to freeze Books Online 2-3 months before the dev team freezes the code in order to complete the final translation work, test all the localized Books Online versions, and have them ready to ship at RTM. We still get feedback from the on-disc copy of the SQL Server 2005 BOL about issues we fixed 5 years ago in the first update. With the new viewer and its ease in delivering updates, we feel that many customers will be using more current information than if we kept shipping the content on the disc.&lt;/li&gt;    &lt;li&gt;While we immediately start working on the first BOL update and publish it at the time customers can order the product, the copy of BOL on the product discs is already somewhat obsolete at RTM. &lt;/li&gt;    &lt;li&gt;The number of customers who prefer online help keeps growing; those customers can skip installing the Books Online content.&lt;/li&gt; &lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10124539" width="1" height="1"&gt;</description></item><item><title>Output parameter streaming feature in SQL Native client 11</title><link>http://blogs.msdn.com/b/sqlblog/archive/2011/01/18/output-parameter-streaming-feature-in-sql-native-client-11.aspx</link><pubDate>Tue, 18 Jan 2011 16:15:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10117147</guid><dc:creator>sqlblog</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/sqlblog/rsscomments.aspx?WeblogPostID=10117147</wfw:commentRss><comments>http://blogs.msdn.com/b/sqlblog/archive/2011/01/18/output-parameter-streaming-feature-in-sql-native-client-11.aspx#comments</comments><description>&lt;p&gt;Recently we had a case where customer wanted to stream output parameter using SNAC 11. Rather than let the good research go to waste, we're posting the steps here.&amp;#160; &lt;/p&gt;  &lt;p&gt;It’s not optimum or sometimes&amp;#160; not even possible to define&amp;#160; large buffer&amp;#160; when the&amp;#160; parameter that is being&amp;#160; fetched from the SQL server is very large, because earlier versions ODBC Driver Manager version 3.8 does not support retrieving the large output parameter in small chunks multiple times.&lt;/p&gt;  &lt;p&gt;Beginning from ODBC&amp;#160; Driver Manager 3.8 &amp;amp; SQL Native Client Version 11.0 supports a new feature called Output Parameter Streaming. Applications&amp;#160; memory footprint size can be reduced using this feature, by&amp;#160; invoking &lt;b&gt;SQLGetData &lt;/b&gt; using small size buffer multiple times&amp;#160; to retrieve large output parameter value.&amp;#160; This feature is supported by ODBC Driver manager version 3.8 and SQL Native client version 11.0 or higher only. &lt;/p&gt;  &lt;p&gt;&lt;b&gt;Lets follow these steps to implement this feature&amp;#160; using sample application:&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;1. Download and install the latest version of Windows platform SDK&amp;#160; &lt;a href="http://msdn.microsoft.com/en-us/windows/bb980924"&gt;http://msdn.microsoft.com/en-us/windows/bb980924&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;2. Install SQL Native Client 11.0 on the application machine or workstation - &lt;a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=6a04f16f-f6be-4f92-9c92-f7e5677d91f9"&gt;http://www.microsoft.com/downloads/en/details.aspx?FamilyID=6a04f16f-f6be-4f92-9c92-f7e5677d91f9&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;3. Create a sample&amp;#160; table and import&amp;#160; some binary data in SQL Server ( For example, SQL 2008, SQL 2008 R2)&lt;/p&gt;  &lt;p&gt;&lt;b&gt;CREATE TABLE TableImage(Document varbinary(max)) INSERT INTO TableImage(Document)&amp;#160; SELECT * FROM OPENROWSET(BULK N'SomeImage.bmp', SINGLE_BLOB) AS I&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;4. Create stored procedure that returns image of given ID:&lt;/p&gt;  &lt;p&gt;CREATE PROCEDURE [dbo].[SP_TestOutputPara] @Param1 integer,&lt;/p&gt;  &lt;p&gt;@Param2 VARBINARY(max) OUTPUT&lt;/p&gt;  &lt;p&gt;AS&lt;/p&gt;  &lt;p&gt;BEGIN&lt;/p&gt;  &lt;p&gt;-- SET NOCOUNT ON added to prevent extra result sets from&lt;/p&gt;  &lt;p&gt;-- interfering with SELECT statements.&lt;/p&gt;  &lt;p&gt;SET NOCOUNT ON;&lt;/p&gt;  &lt;p&gt;SELECT @Param2 = [Document]&amp;#160; FROM [pubs].[dbo].[TableImage] where [TableImage].[id]&amp;#160; = 1&lt;/p&gt;  &lt;p&gt;END&lt;/p&gt;  &lt;p&gt;GO&lt;/p&gt;  &lt;p&gt;5. Define DSN using SQL Native Client&amp;#160; Version 11.0&amp;#160; to point to the database that hosts the table and SP created at the above steps 3 &amp;amp; 4&lt;/p&gt;  &lt;p&gt;6. The sample code that shows&amp;#160; how to bind&amp;#160; the&amp;#160; streamed output parameter and retrieve the large output&amp;#160; parameter multiple times&amp;#160; using &lt;b&gt;SQLGetData()&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;BOOL &lt;b&gt;GetBinaryDataInChunks&lt;/b&gt;(SQLUINTEGER idOfPicture, SQLHSTMT hstmt) &lt;/p&gt;  &lt;p&gt;{&lt;/p&gt;  &lt;p&gt;SQLINTEGER lengthOfPicture=SQL_DATA_AT_EXEC; &lt;/p&gt;  &lt;p&gt;SQLPOINTER ParamValuePtr = (SQLPOINTER) 2;&lt;/p&gt;  &lt;p&gt;BYTE&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; smallBuffer[2048];&amp;#160;&amp;#160; // A very small buffer.&lt;/p&gt;  &lt;p&gt;SQLRETURN&amp;#160;&amp;#160; retcode, retcode2;&lt;/p&gt;  &lt;p&gt;// Bind the first parameter (input parameter)&lt;/p&gt;  &lt;p&gt;retcode = &lt;b&gt;SQLBindParameter&lt;/b&gt;(hstmt,&lt;/p&gt;  &lt;p&gt;1,&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // The first parameter. &lt;/p&gt;  &lt;p&gt; SQL_PARAM_INPUT,&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // Input parameter: The ID_of_picture.&lt;/p&gt;  &lt;p&gt;SQL_C_ULONG,&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // The C Data Type of the ID.&lt;/p&gt;  &lt;p&gt;SQL_INTEGER,&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // The Param-Type of the ID.&lt;/p&gt;  &lt;p&gt;0,&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // ColumnSize is ignored for integer.&lt;/p&gt;  &lt;p&gt;0,&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // DecimalDigits is ignored for integer.&lt;/p&gt;  &lt;p&gt;&amp;amp;idOfPicture,&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // The Address of the buffer for the input parameter.&lt;/p&gt;  &lt;p&gt;0,&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // Buffer length is ignored for integer.&lt;/p&gt;  &lt;p&gt;NULL);&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // This is ignored for integer.&lt;/p&gt;  &lt;p&gt;if (retcode != SQL_SUCCESS)&lt;/p&gt;  &lt;p&gt;Return FALSE;&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // Bind the streamed output parameter.&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; retcode = &lt;b&gt;SQLBindParameter&lt;/b&gt;(hstmt, &lt;/p&gt;  &lt;p&gt;&amp;#160; 2,&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // The second parameter.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;SQL_PARAM_OUTPUT_STREAM&lt;/b&gt;,&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // A streamed output parameter. &lt;/p&gt;  &lt;p&gt;&amp;#160; SQL_C_BINARY,&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // The C Data Type of the picture.&amp;#160; &lt;/p&gt;  &lt;p&gt;&amp;#160; SQL_VARBINARY,&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // The Param-Type of the picture.&lt;/p&gt;  &lt;p&gt;&amp;#160; 0,&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // ColumnSize: The maximum size of varbinary(max).&lt;/p&gt;  &lt;p&gt;&amp;#160; 0,&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // DecimalDigits is ignored for binary type.&lt;/p&gt;  &lt;p&gt;&amp;#160; (SQLPOINTER)2,&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // ParameterValuePtr: An application-defined. token (this will be returned from SQLParamData).&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // In this example, we used the ordinal&amp;#160; of the parameter.&lt;/p&gt;  &lt;p&gt;0,&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // This is ignored for streamed output parameters.&lt;/p&gt;  &lt;p&gt;&amp;amp;lengthOfPicture);&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // StrLen_or_IndPtr: The status variable returned. &lt;/p&gt;  &lt;p&gt;if (retcode != SQL_SUCCESS)&lt;/p&gt;  &lt;p&gt;Return FALSE;&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160; retcode = SQLPrepare(hstmt,(SQLCHAR*) &amp;quot;{call SP_TestOututPara(?, ?)}&amp;quot;, SQL_NTS);&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160; if ( retcode == SQL_ERROR )&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return FALSE;&lt;/p&gt;  &lt;p&gt;//&lt;b&gt;Execute the stored procedure.&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160; retcode = SQLExecute(hstmt);&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160; if ( retcode == SQL_ERROR )&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return FALSE;&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160; // Assume that the retrieved picture exists. Use SQLBindCol or SQLGetData to retrieve the result-set.&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160; // &lt;b&gt;Process the result set and move to the streamed output parameters.&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; retcode = SQLMoreResults( hstmt );&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160; // &lt;b&gt;SQLGetData retrieves and displays the picture in parts. The streamed output parameter is available.&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160; while (retcode == SQL_PARAM_DATA_AVAILABLE)&amp;#160; &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160; {&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SQLPOINTER token;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // Output by SQLParamData.&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SQLINTEGER cbLeft;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // #bytes remained &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; retcode = &lt;b&gt;SQLParamData&lt;/b&gt;(hstmt, &amp;amp;token);&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if ( retcode == SQL_PARAM_DATA_AVAILABLE )&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; do &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; retcode2 = &lt;b&gt;SQLGetData&lt;/b&gt;(hstmt, &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; (UWORD) token,&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // the value of the token is the ordinal. &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SQL_C_BINARY,&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // The C-type of the picture.&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; smallBuffer,&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // A small buffer. &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; sizeof(smallBuffer),&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // The size of the buffer.&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; &amp;amp;cbLeft);&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // How much data we can get.&lt;/p&gt;  &lt;p&gt;&amp;#160; //Print the buffer. &lt;/p&gt;  &lt;p&gt;cout &amp;lt;&amp;lt; smallBuffer &amp;lt;&amp;lt; &amp;quot;\n&amp;quot;;&lt;/p&gt;  &lt;p&gt;if (retcode2 == SQL_ERROR)&lt;/p&gt;  &lt;p&gt;Return FALSE;&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; while ( retcode2 == SQL_SUCCESS_WITH_INFO );&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160; return TRUE;&lt;/p&gt;  &lt;p&gt;}&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Further references:&lt;/b&gt;&lt;b&gt; &lt;/b&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;What are the new features in SQL Native Client Version 11.0 &lt;a href="http://msdn.microsoft.com/en-us/library/cc280510(SQL.110).aspx"&gt;http://msdn.microsoft.com/en-us/library/cc280510(SQL.110).aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Retrieving Output parameters - &lt;a href="http://msdn.microsoft.com/en-us/library/ms712625(VS.85).aspx"&gt;http://msdn.microsoft.com/en-us/library/ms712625(VS.85).aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The ODBC 3.8 features supported in&amp;#160; code name &amp;quot;Denali&amp;quot; or&amp;#160; SNAC 11&amp;#160; - &lt;a href="http://blogs.msdn.com/b/sqlnativeclient/archive/2010/11/16/sql-server-code-named-quot-denali-quot-native-client-supporting-odbc-3-8.aspx"&gt;http://blogs.msdn.com/b/sqlnativeclient/archive/2010/11/16/sql-server-code-named-quot-denali-quot-native-client-supporting-odbc-3-8.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Author : Srini(MSFT), SQL Developer Engineer&lt;/p&gt;  &lt;p&gt;Reviewed by : Enamul(MSFT), SQL Developer Technical Lead&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10117147" width="1" height="1"&gt;</description></item><item><title>SharePoint 2007 using ADFS v1 authentication integrated with Reporting Services 2008 : "Object Moved" error</title><link>http://blogs.msdn.com/b/sqlblog/archive/2011/01/10/sharepoint-2007-using-adfs-v1-authentication-integrated-with-reporting-services-2008-quot-object-moved-quot-error.aspx</link><pubDate>Mon, 10 Jan 2011 17:26:26 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10113769</guid><dc:creator>sqlblog</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/sqlblog/rsscomments.aspx?WeblogPostID=10113769</wfw:commentRss><comments>http://blogs.msdn.com/b/sqlblog/archive/2011/01/10/sharepoint-2007-using-adfs-v1-authentication-integrated-with-reporting-services-2008-quot-object-moved-quot-error.aspx#comments</comments><description>&lt;p&gt;If SharePoint 2007 is configured to use Web SSO authentication by using &lt;a href="http://technet.microsoft.com/en-us/library/cc287811(office.12).aspx"&gt;ADFS v1&lt;/a&gt;, when trying to render a RS 2008 Report in SharePoint integrated mode, the following error occurs when clicking on the report:    &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#ff0000"&gt;An unexpected error occured while connecting to the report server. Verify that the report server is available and configured for SharePoint integrated mode. --&amp;gt; The request failed with the error message:     &lt;br /&gt;--      &lt;br /&gt;&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;Object moved&amp;lt;/title&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;      &lt;br /&gt;&amp;lt;h2&amp;gt;Object moved to &amp;lt;a href=&amp;quot;http://&amp;lt;_ADFS_signin_link_&amp;gt;&amp;quot;&amp;gt;here&amp;lt;/a&amp;gt;.&amp;lt;/h2&amp;gt;      &lt;br /&gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;      &lt;br /&gt;&lt;/font&gt;--&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Cause: Please note that this behavior is by design. The reporting Service webpart calls the “SharePoint Proxy Endpoints&amp;quot; (see &lt;a href="http://msdn.microsoft.com/en-us/library/bb326209(SQL.90).aspx"&gt;http://msdn.microsoft.com/en-us/library/bb326209(SQL.90).aspx).&lt;/a&gt;    &lt;br /&gt;Requests from viewer and management pages are sent through these Proxy Endpoints. Neither code path forwards cookies. As a consequence, ADFS considers the call unauthenticated and redirects to the ADFS login page.&lt;/p&gt;  &lt;p&gt;Resolution: To solve this issue, use SharePoint 2010 instead of SharePoint 2007. In SharePoint 2010, the RS webpart viewer and management pages send requests directly to the report server.   &lt;br /&gt;As Claims Based Authentication is not supported for SharePoint integration between SharePoint 2010 and Reporting Services 2008, you will also need to use Reporting Services 2008 &lt;b&gt;R2&lt;/b&gt;.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Cédric Naudy&lt;/p&gt;  &lt;p&gt;SQL Server Support.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10113769" width="1" height="1"&gt;</description></item><item><title>Why SSIS package runs little slower on the first run</title><link>http://blogs.msdn.com/b/sqlblog/archive/2011/01/01/why-ssis-package-runs-little-slower-on-the-first-run.aspx</link><pubDate>Sat, 01 Jan 2011 05:17:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10110742</guid><dc:creator>sqlblog</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/sqlblog/rsscomments.aspx?WeblogPostID=10110742</wfw:commentRss><comments>http://blogs.msdn.com/b/sqlblog/archive/2011/01/01/why-ssis-package-runs-little-slower-on-the-first-run.aspx#comments</comments><description>&lt;p&gt;When a package is being loaded, the runtime will enumerate all of the connection managers, tasks, and data flow components on the system. It does this by looking in certain directories (under &amp;lt;sql&amp;gt;\100\dts), and also by looking in COM registry for classes that implement certain interfaces. Because this iteration can take a while, we cache this information with the SSIS service. &lt;/p&gt;  &lt;p&gt;This might explain the performance difference you’re seeing on the first run of the package.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Author : Enamul(MSFT), SQL Developer Technical Lead&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10110742" width="1" height="1"&gt;</description></item><item><title>Have you checked the MaximumErrorCount in your SSIS Package ?</title><link>http://blogs.msdn.com/b/sqlblog/archive/2011/01/01/have-you-checked-the-maximumerrorcount-in-your-ssis-package.aspx</link><pubDate>Sat, 01 Jan 2011 05:06:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10110740</guid><dc:creator>sqlblog</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/sqlblog/rsscomments.aspx?WeblogPostID=10110740</wfw:commentRss><comments>http://blogs.msdn.com/b/sqlblog/archive/2011/01/01/have-you-checked-the-maximumerrorcount-in-your-ssis-package.aspx#comments</comments><description>&lt;p&gt;Recently we came across a case where the customer was running a Data Flow Task that was executing to it's completion without transferring any data.&amp;#160; We finally figured out the whys. Rather than let the good research go to waste, we're posting the results here.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Source&lt;/strong&gt;: SQLServer OLEDB Provider&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Destination&lt;/strong&gt;: SQLServer OLEDB Provider&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Transform&lt;/strong&gt;: Data Flow Task (DFT)&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Frist we thought the Source table was empty. But after querying the table, we found it had 300+ rows. After enabling SSIS log and redeploying the package, we found that the package was encountering a datatype mismatch but weirdly enough, it was reporting successful completion. Then we found that the Maximum Error Count for the package was set to 9999. This explains why the package was silently swallowing error and reporting successful completion. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-71-65-metablogapi/3058.Capture.jpg"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 5px 5px 5px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Capture" border="0" alt="Capture" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-71-65-metablogapi/5224.Capture_5F00_thumb.jpg" width="467" height="181" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;We changed that to 1 and the package stopped at error as expected.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;So, if your SSIS package shows any weird behavior, don't forget to check the MaximumErrorCount field !&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Author : Enamul(MSFT), SQL Developer Technical Lead&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10110740" width="1" height="1"&gt;</description></item><item><title>Configuration changes needed for running SSIS 2008/2008 R2 classes in .NET4.0</title><link>http://blogs.msdn.com/b/sqlblog/archive/2010/11/04/configuration-changes-needed-for-running-ssis-2008-2008-r2-classes-in-net4-0.aspx</link><pubDate>Thu, 04 Nov 2010 15:32:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10086140</guid><dc:creator>sqlblog</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/sqlblog/rsscomments.aspx?WeblogPostID=10086140</wfw:commentRss><comments>http://blogs.msdn.com/b/sqlblog/archive/2010/11/04/configuration-changes-needed-for-running-ssis-2008-2008-r2-classes-in-net4-0.aspx#comments</comments><description>&lt;p&gt;Recently we came across a case where the customer was developing a .NET managed application using SQL Server Integration Services (SSIS) object model.&amp;#160; The managed application was behaving differently in different versions of Visual Studio (2008 vs 2010). We finally figured out the whys. Rather than let the good research go to waste, we're posting the results here.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;u&gt;Quick background&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;The managed assemblies that are commonly used when programming Integration Services using the .NET Framework are:&lt;/p&gt;  &lt;p&gt;&lt;em&gt;Microsoft.SqlServer.ManagedDTS.dll     &lt;br /&gt;Microsoft.SqlServer.RuntimeWrapper.dll      &lt;br /&gt;Microsoft.SqlServer.PipelineHost.dll      &lt;br /&gt;Microsoft.SqlServer.PipelineWrapper.dll      &lt;br /&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;These assemblies contain various namespaces, such as at &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.dts.runtime.aspx"&gt;http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.dts.runtime.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;u&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;&lt;u&gt;&lt;strong&gt;Code Segment&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-71-65-metablogapi/5531.maincode_5F00_2.jpg"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 5px 5px 5px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="maincode" border="0" alt="maincode" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-71-65-metablogapi/3312.maincode_5F00_thumb.jpg" width="517" height="397" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Note: This example requires a reference to the Microsoft.SqlServer.ManagedDTS.dll and Microsoft.SqlServer.SQLTask.dll assemblies. &lt;/p&gt;  &lt;p&gt;For reference: &lt;a href="http://msdn.microsoft.com/en-us/library/ms345167.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms345167.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;u&gt;Behavior Differences in VS2008 vs VS2010&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;When you run the above code in Visual Studio 2008 and in Visual Studio 2010 you will get different results (the value will be null for the object myExecuteSQLTask for VS 2010) as shown below:&lt;/p&gt;  &lt;p&gt;&lt;b&gt;VS 2008:&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-71-65-metablogapi/7563.VS2008_5F00_2.jpg"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 5px 5px 5px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="VS2008" border="0" alt="VS2008" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-71-65-metablogapi/5428.VS2008_5F00_thumb.jpg" width="602" height="413" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;VS 2010:&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-71-65-metablogapi/0310.VS2010_5F00_2.jpg"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 5px 5px 5px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="VS2010" border="0" alt="VS2010" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-71-65-metablogapi/4035.VS2010_5F00_thumb.jpg" width="613" height="466" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;u&gt;&lt;font color="#333333"&gt;The Solution:&lt;/font&gt;&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;The reason of this behavior is a mismatch of .NET framework between Visual Studio 2010 and those managed assemblies (Microsoft.SqlServer.ManagedDTS.dll, Microsoft.SqlServer.RuntimeWrapper.dll, Microsoft.SqlServer.PipelineHost.dll, Microsoft.SqlServer.PipelineWrapper.dll) that come with SQL 2008/2008 R2. Visual Studio uses .NET Framework 4.0 whereas those assemblies are compiled against .NET Framework 3.5.&lt;/p&gt;  &lt;p&gt;The .NET application configuration can be used to handle this. If your application is built with the .NET Framework 4 but has a dependency on a mixed-mode assembly built with an earlier version of the .NET Framework we should use &amp;lt;supportedRuntime&amp;gt; Element in the configuration file. This element specifies which versions of the common language runtime the application supports. In addition, in the &amp;lt;startup&amp;gt; element in configuration file, we must set the useLegacyV2RuntimeActivationPolicy attribute to true. However, setting this attribute to true means that all components built with earlier versions of the .NET Framework are run using the .NET Framework 4 instead of the runtimes they were built with. &lt;/p&gt;  &lt;p&gt;Reference: &lt;a href="http://msdn.microsoft.com/en-us/library/bbx34a2h.aspx"&gt;http://msdn.microsoft.com/en-us/library/bbx34a2h.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Placing the following section in the configuration file of the application should take care of this issue:&lt;/p&gt;  &lt;p&gt;&amp;lt;configuration&amp;gt;   &lt;br /&gt;&amp;#160; &amp;lt;startup useLegacyV2RuntimeActivationPolicy=&amp;quot;true&amp;quot;&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;supportedRuntime version=&amp;quot;v4.0&amp;quot;/&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;supportedRuntime version=&amp;quot;v2.0.50727&amp;quot;/&amp;gt;    &lt;br /&gt;&amp;#160; &amp;lt;/startup&amp;gt;    &lt;br /&gt;&amp;lt;/configuration&amp;gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;      &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Author : Faiz(MSFT), SQL Developer Engineer; Enamul(MSFT), SQL Developer Technical Lead&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10086140" width="1" height="1"&gt;</description></item><item><title>How to enable TDS parser to display TDS frames when SQLServer is listening on port other than default 1433</title><link>http://blogs.msdn.com/b/sqlblog/archive/2010/06/30/how-to-fix-tds-parser-to-display-tds-frames-when-sqlserver-is-listening-on-port-other-than-default-1433.aspx</link><pubDate>Wed, 30 Jun 2010 22:47:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10033175</guid><dc:creator>sqlblog</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/sqlblog/rsscomments.aspx?WeblogPostID=10033175</wfw:commentRss><comments>http://blogs.msdn.com/b/sqlblog/archive/2010/06/30/how-to-fix-tds-parser-to-display-tds-frames-when-sqlserver-is-listening-on-port-other-than-default-1433.aspx#comments</comments><description>&lt;p&gt;If you try to view a netmon trace in Netmon 3.4, you will see TDS traffic is nicely parsed for you. You will see a display similar to this:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-71-65-metablogapi/3482.clip_5F00_image001_5F00_2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image001" border="0" alt="clip_image001" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-71-65-metablogapi/0777.clip_5F00_image001_5F00_thumb.png" width="485" height="220" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The parsing works nicely because SQLServer is listening on default tcp port 1433. But, if your SQLServer is listening on a different port (other than 1433), then these TDS parsing won't work by default. You will see a display similar to this (no frames resolving to TDS):&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-71-65-metablogapi/5148.clip_5F00_image002_5F00_2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image002" border="0" alt="clip_image002" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-71-65-metablogapi/1832.clip_5F00_image002_5F00_thumb.png" width="497" height="241" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;To enable the parser to parse TDS traffic for ports other than 1433 (in this case, 63959), we need to take following steps:&lt;/p&gt;  &lt;p&gt;1. Click on &amp;quot;Parsers&amp;quot; tab in netmon UI. This will display list of parsers installed. You will see tcp.npl, tds.npl along with several different parsers &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-71-65-metablogapi/1351.clip_5F00_image003_5F00_2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image003" border="0" alt="clip_image003" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-71-65-metablogapi/1263.clip_5F00_image003_5F00_thumb.png" width="290" height="316" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;2. Double click on tcp.npl and search for &amp;quot;1433&amp;quot;, you will get into a switch/case code block saying &amp;quot;case 1433&amp;quot;. We basically need to include our port 63959 here. Just add a case statement above “case 1433” without any parsing code.&lt;/p&gt;  &lt;p&gt;case 63959:&lt;/p&gt;  &lt;p&gt;case 1433:&lt;/p&gt;  &lt;p&gt; //TDS-parsing code goes here&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;This is what it’s look like after the change:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-71-65-metablogapi/3731.image_5F00_2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-71-65-metablogapi/7140.image_5F00_thumb.png" width="528" height="186" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;3. Save your changes&lt;/p&gt;  &lt;p&gt;4. Reload your netmon trace, now it should look like following. With the change, TDS parser will resolve TDS traffic on this particular non-default port (63959).&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-71-65-metablogapi/6177.clip_5F00_image005_5F00_2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image005" border="0" alt="clip_image005" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-71-65-metablogapi/7242.clip_5F00_image005_5F00_thumb.png" width="523" height="203" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Author : Enamul(MSFT), SQL Developer Technical Lead&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10033175" width="1" height="1"&gt;</description></item><item><title>Commonly used 32-bit CPU registers and their purpose</title><link>http://blogs.msdn.com/b/sqlblog/archive/2010/06/30/commonly-used-32-bit-cpu-registers-and-their-purpose.aspx</link><pubDate>Wed, 30 Jun 2010 21:54:30 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10033147</guid><dc:creator>sqlblog</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/sqlblog/rsscomments.aspx?WeblogPostID=10033147</wfw:commentRss><comments>http://blogs.msdn.com/b/sqlblog/archive/2010/06/30/commonly-used-32-bit-cpu-registers-and-their-purpose.aspx#comments</comments><description>&lt;p&gt;While debugging a dump, we commonly see various CPU registers. Each register has different purpose. I am trying to put them together in one place for your easy reference.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;You can list all the registers in windbg with “r” command:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-71-65-metablogapi/1157.Register.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Register" border="0" alt="Register" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-71-65-metablogapi/3704.Register_5F00_thumb.jpg" width="609" height="162" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Please note that a given register may be used for general purpose at any time.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;EAX:&lt;/strong&gt; Arithmetic operations, I/O port access and interrupt call&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;EDX:&lt;/strong&gt; Arithmetic operations, I/O port access and interrupt call. If you have a multiplication operation which results in more than what a single register can handle, then the most significant 16 numbers are stored in EDX and least significant ones are stored in EAX&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;EBX:&lt;/strong&gt; Holds return values&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;ECX&lt;/strong&gt;: Used for loop counters. Also used for &amp;quot;this&amp;quot; pointer for a class&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;EIP&lt;/strong&gt;: Instruction pointer. Points to the next instruction to execute.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;ESP&lt;/strong&gt;: Stack pointer. This points to the top of the stack.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;EBP&lt;/strong&gt;: Base/Frame pointer.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Author : Enamul(MSFT), SQL Developer Technical Lead&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10033147" width="1" height="1"&gt;</description></item><item><title>Step by step N-tier configuration of Sync services for ADO.NET 2.0</title><link>http://blogs.msdn.com/b/sqlblog/archive/2010/04/19/step-by-step-n-tier-configuration-of-sync-services-for-ado-net-2-0.aspx</link><pubDate>Mon, 19 Apr 2010 22:00:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9998753</guid><dc:creator>sqlblog</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/sqlblog/rsscomments.aspx?WeblogPostID=9998753</wfw:commentRss><comments>http://blogs.msdn.com/b/sqlblog/archive/2010/04/19/step-by-step-n-tier-configuration-of-sync-services-for-ado-net-2-0.aspx#comments</comments><description>&lt;p&gt;Recently I have worked on couple of cases where customers were trying to use N-tier configuration of Sync services for ADO.NET on IIS. In this blog we will use IIS and setup N-tier configuration of sync service for ADO.NET version 2.0 which comes as part of Microsoft Sync Framework 1.0.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Preparing Environment:&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;We need a development machine that we will use to develop the application, a middle tier server where IIS is installed and configured for WCF services and database server. If you like, you can use the same development box for IIS and database server too.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;a) &lt;/b&gt;&lt;b&gt;Client tier&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;We will develop the application (client and WCF service) and run the client part of the application in this machine. We will use Visual Studio 2008, SP1, so it should be installed on this machine. &lt;/p&gt;  &lt;p&gt;Install sync services on this client machine. Sync Services for ADO.NET version 2.0 comes with Microsoft Sync Framework 1.0 which gets installed if you install SQL Server 2008 or Visual studio 2008, SP1. You can also download it from &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=C88BA2D1-CEF3-4149-B301-9B056E7FB1E6&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyId=C88BA2D1-CEF3-4149-B301-9B056E7FB1E6&amp;amp;displaylang=en&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Install SQL Server Compact 3.5 Service Pack 1 on this client machine if it is already not there. SQL Server Compact is available in three ways: - Integrated with SQL Server 2008 or later versions, Integrated with Microsoft Visual Studio 2008 or later versions and as a download from the Web site at: &lt;a href="http://www.microsoft.com/sqlserver/2005/en/us/compact-downloads.aspx"&gt;http://www.microsoft.com/sqlserver/2005/en/us/compact-downloads.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;b) &lt;/b&gt;&lt;b&gt;Middle tier&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;If you want to use a separated middle tier server for IIS to run WCF service then make sure you have IIS installed and configured on this box to run WCF. Install sync services on this machine too. I have used the same development machine for middle tier so I did not have to install it again.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;c) &lt;/b&gt;&lt;b&gt;Database Server&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Install a version of SQL Server other than SQL Server Compact to act as the server database. If you like to you can use SQL Server Express that installs with Visual Studio. I have used developer edition of SQL 2008, SP1. &lt;/p&gt;  &lt;p&gt;We are going to use a sample database that should be prepared by following the article on “Setup Scripts for Sync Services How-to Topics” at: &lt;a href="http://msdn.microsoft.com/en-us/library/bb726041.aspx"&gt;http://msdn.microsoft.com/en-us/library/bb726041.aspx&lt;/a&gt;. Copy the T-SQL statements of “Custom Change Tracking for Offline Scenarios” that creates a custom change tracking infrastructure. Once you run this script successfully from query analyzer of your SQL Server it will create the new database by the name SyncSamplesDb. I have the database created as shown below:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/StepbystepNtierconfigurationofSyncserv.0_ED0D/clip_image001_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image001" border="0" alt="clip_image001" src="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/StepbystepNtierconfigurationofSyncserv.0_ED0D/clip_image001_thumb.jpg" width="318" height="335" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Developing and deploying WCF service:&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Create a WCF Services Application in Visual Studio 2008: (You may need to run Visual Studio as Administrator to create virtual directories in IIS)&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;a href="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/StepbystepNtierconfigurationofSyncserv.0_ED0D/clip_image002_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image002" border="0" alt="clip_image002" src="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/StepbystepNtierconfigurationofSyncserv.0_ED0D/clip_image002_thumb.jpg" width="483" height="330" /&gt;&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Type “WcfForSync” as the name of the project and&amp;#160; click on “OK” button. It will create the WCF project with IService1.cs, Service1.svc, Service1.svc.cs and Web.config files with other files and folders. I will keep these default files for simplicity.&lt;/p&gt;  &lt;p&gt;Open the IService1.cs file by double clicking it and replace the code with the code below: (Note that the code samples in the following sections have been taken from the MSDN articles mentioned in the reference section at the bottom with little modification)&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;using System.Collections.ObjectModel;&lt;/p&gt;  &lt;p&gt;using System.ServiceModel;&lt;/p&gt;  &lt;p&gt;using System.Data;&lt;/p&gt;  &lt;p&gt;using Microsoft.Synchronization;&lt;/p&gt;  &lt;p&gt;using Microsoft.Synchronization.Data;&lt;/p&gt;  &lt;p&gt;using Microsoft.Synchronization.Data.Server;&lt;/p&gt;  &lt;p&gt;namespace WcfForSync&lt;/p&gt;  &lt;p&gt;{&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; [ServiceContract]&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; public interface IService1&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; [OperationContract()]&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SyncContext ApplyChanges(SyncGroupMetadata groupMetadata, DataSet dataSet, SyncSession syncSession);&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; [OperationContract()]&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SyncContext GetChanges(SyncGroupMetadata groupMetadata, SyncSession syncSession);&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; [OperationContract()]&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SyncSchema GetSchema(Collection&amp;lt;string&amp;gt; tableNames, SyncSession syncSession);&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; [OperationContract()]&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SyncServerInfo GetServerInfo(SyncSession syncSession);&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;}&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Next add a class file by the name SampleServerSyncProvider.cs as below:&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;a href="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/StepbystepNtierconfigurationofSyncserv.0_ED0D/clip_image003_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image003" border="0" alt="clip_image003" src="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/StepbystepNtierconfigurationofSyncserv.0_ED0D/clip_image003_thumb.jpg" width="463" height="316" /&gt;&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Replace the code in this file with the code below:&lt;/p&gt;  &lt;p&gt;using System.Data;&lt;/p&gt;  &lt;p&gt;using System.Data.SqlClient;&lt;/p&gt;  &lt;p&gt;using Microsoft.Synchronization;&lt;/p&gt;  &lt;p&gt;using Microsoft.Synchronization.Data;&lt;/p&gt;  &lt;p&gt;using Microsoft.Synchronization.Data.Server;&lt;/p&gt;  &lt;p&gt;namespace WcfForSync&lt;/p&gt;  &lt;p&gt;{&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; //Create a class that is derived from &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; //Microsoft.Synchronization.Server.DbServerSyncProvider.&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; public class SampleServerSyncProvider : DbServerSyncProvider&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; public SampleServerSyncProvider()&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Create a connection to the sample server database.&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Utility util = new Utility();&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SqlConnection serverConn = new SqlConnection(util.ServerConnString);&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; this.Connection = serverConn;&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Create a command to retrieve a new anchor value from&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //the server. In this case, we use a timestamp value&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //that is retrieved and stored in the client database.&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //During each synchronization, the new anchor value and&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //the last anchor value from the previous synchronization&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //are used: the set of changes between these upper and&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //lower bounds is synchronized.&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //SyncSession.SyncNewReceivedAnchor is a string constant; &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //you could also use @sync_new_received_anchor directly in &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //your queries.&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SqlCommand selectNewAnchorCommand = new SqlCommand();&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; string newAnchorVariable = &amp;quot;@&amp;quot; + SyncSession.SyncNewReceivedAnchor;&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; selectNewAnchorCommand.CommandText = &amp;quot;SELECT &amp;quot; + newAnchorVariable + &amp;quot; = min_active_rowversion() - 1&amp;quot;;&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; selectNewAnchorCommand.Parameters.Add(newAnchorVariable, SqlDbType.Timestamp);&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; selectNewAnchorCommand.Parameters[newAnchorVariable].Direction = ParameterDirection.Output;&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; selectNewAnchorCommand.Connection = serverConn;&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; this.SelectNewAnchorCommand = selectNewAnchorCommand;&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Create a SyncAdapter for the Customer table by using &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //the SqlSyncAdapterBuilder:&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //&amp;#160; * Specify the base table and tombstone table names.&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //&amp;#160; * Specify the columns that are used to track when&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //&amp;#160;&amp;#160;&amp;#160; changes are made.&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //&amp;#160; * Specify download-only synchronization.&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //&amp;#160; * Call ToSyncAdapter to create the SyncAdapter.&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //&amp;#160; * Specify a name for the SyncAdapter that matches the&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //&amp;#160;&amp;#160;&amp;#160; the name specified for the corresponding SyncTable.&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //&amp;#160;&amp;#160;&amp;#160; Do not include the schema names (Sales in this case).&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SqlSyncAdapterBuilder customerBuilder = new SqlSyncAdapterBuilder(serverConn);&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; customerBuilder.TableName = &amp;quot;Sales.Customer&amp;quot;;&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; customerBuilder.TombstoneTableName = customerBuilder.TableName + &amp;quot;_Tombstone&amp;quot;;&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; customerBuilder.SyncDirection = SyncDirection.DownloadOnly;&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; customerBuilder.CreationTrackingColumn = &amp;quot;InsertTimestamp&amp;quot;;&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; customerBuilder.UpdateTrackingColumn = &amp;quot;UpdateTimestamp&amp;quot;;&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; customerBuilder.DeletionTrackingColumn = &amp;quot;DeleteTimestamp&amp;quot;;&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SyncAdapter customerSyncAdapter = customerBuilder.ToSyncAdapter();&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; customerSyncAdapter.TableName = &amp;quot;Customer&amp;quot;;&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; this.SyncAdapters.Add(customerSyncAdapter);&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; public class Utility&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Return the server connection string. &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; public string ServerConnString&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; get { return @&amp;quot;Data Source= SQLServer\instance; Initial Catalog=SyncSamplesDb; User Id=xxxxxx; Password=xxxxxx&amp;quot;; }&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;}&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Note: You need to update the connection string in the above Utility class to connect to your SQL Server.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Open Service1.svc.cs file in the project by double clicking on it:&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;a href="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/StepbystepNtierconfigurationofSyncserv.0_ED0D/clip_image004_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image004" border="0" alt="clip_image004" src="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/StepbystepNtierconfigurationofSyncserv.0_ED0D/clip_image004_thumb.jpg" width="237" height="244" /&gt;&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;and replace the existing code with the code below:&lt;/p&gt;  &lt;p&gt;using System.Collections.ObjectModel;&lt;/p&gt;  &lt;p&gt;using System.ServiceModel;&lt;/p&gt;  &lt;p&gt;using System.Data;&lt;/p&gt;  &lt;p&gt;using Microsoft.Synchronization;&lt;/p&gt;  &lt;p&gt;using Microsoft.Synchronization.Data;&lt;/p&gt;  &lt;p&gt;using Microsoft.Synchronization.Data.Server;&lt;/p&gt;  &lt;p&gt;namespace WcfForSync&lt;/p&gt;  &lt;p&gt;{&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; // NOTE: If you change the class name &amp;quot;Service1&amp;quot; here, you must also update the reference to &amp;quot;Service1&amp;quot; in App.config.&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; public class Service1 : IService1&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; private SampleServerSyncProvider _serverSyncProvider;&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; public Service1()&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; this._serverSyncProvider = new SampleServerSyncProvider();&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; [System.Diagnostics.DebuggerNonUserCodeAttribute()]&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; public virtual SyncContext ApplyChanges(SyncGroupMetadata groupMetadata, DataSet dataSet, SyncSession syncSession)&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return this._serverSyncProvider.ApplyChanges(groupMetadata, dataSet, syncSession);&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; [System.Diagnostics.DebuggerNonUserCodeAttribute()]&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; public virtual SyncContext GetChanges(SyncGroupMetadata groupMetadata, SyncSession syncSession)&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return this._serverSyncProvider.GetChanges(groupMetadata, syncSession);&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; [System.Diagnostics.DebuggerNonUserCodeAttribute()]&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; public virtual SyncSchema GetSchema(Collection&amp;lt;string&amp;gt; tableNames, SyncSession syncSession)&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return this._serverSyncProvider.GetSchema(tableNames, syncSession);&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; [System.Diagnostics.DebuggerNonUserCodeAttribute()]&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; public virtual SyncServerInfo GetServerInfo(SyncSession syncSession)&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return this._serverSyncProvider.GetServerInfo(syncSession);&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;}&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;The application requires references to Microsoft.Synchronization.dll, Microsoft.Synchronization.Data.dll and Microsoft.Synchronization.Data.Server.dll. Right click on “References” from the project and click on Add Reference…&lt;/p&gt;  &lt;p&gt;Select Microsoft.Synchronization.dll (Location on my machine: C:\Program Files (x86)\Microsoft Sync Framework\v1.0\Runtime\x86)&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;a href="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/StepbystepNtierconfigurationofSyncserv.0_ED0D/clip_image005_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image005" border="0" alt="clip_image005" src="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/StepbystepNtierconfigurationofSyncserv.0_ED0D/clip_image005_thumb.jpg" width="460" height="301" /&gt;&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;And next add the references to the other two dlls (Location on my machine: C:\Program Files (x86)\Microsoft Sync Framework\v1.0\Runtime\ADO.NET\V2.0\x86)&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;a href="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/StepbystepNtierconfigurationofSyncserv.0_ED0D/clip_image006_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image006" border="0" alt="clip_image006" src="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/StepbystepNtierconfigurationofSyncserv.0_ED0D/clip_image006_thumb.jpg" width="483" height="320" /&gt;&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Now you should be able to build the project successfully. Once building is successful publish the WCF to IIS. Go to the properties of the project and under Web* tab type IIS server information (middletierserver) , click on the “Create Virtual Directory” as below:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/StepbystepNtierconfigurationofSyncserv.0_ED0D/clip_image007_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image007" border="0" alt="clip_image007" src="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/StepbystepNtierconfigurationofSyncserv.0_ED0D/clip_image007_thumb.jpg" width="415" height="455" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;From IIS you can see a Virtual directory has been created:&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;a href="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/StepbystepNtierconfigurationofSyncserv.0_ED0D/clip_image008_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image008" border="0" alt="clip_image008" src="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/StepbystepNtierconfigurationofSyncserv.0_ED0D/clip_image008_thumb.jpg" width="491" height="282" /&gt;&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;If you browse the WCF (&lt;a href="http://middletierserver/WcfForSync/Service1.svc"&gt;http://middletierserver/WcfForSync/Service1.svc&lt;/a&gt;) you should get the following page. I have used the same development machine for IIS, so it is showing “localhost” in the URL. &lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;a href="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/StepbystepNtierconfigurationofSyncserv.0_ED0D/clip_image009_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image009" border="0" alt="clip_image009" src="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/StepbystepNtierconfigurationofSyncserv.0_ED0D/clip_image009_thumb.jpg" width="481" height="438" /&gt;&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Note:&lt;/p&gt;  &lt;p&gt;When tried to browse WCF I have noticed following error with some IIS machines:&lt;/p&gt;  &lt;p&gt;HTTP Error 404.3 – Not Found&lt;/p&gt;  &lt;p&gt;The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map. Detailed Error InformationModule StaticFileModule.&lt;/p&gt;  &lt;p&gt;If you encounter this error please take necessary action as per article at: &lt;a href="http://blogs.msdn.com/rjohri/archive/2009/06/29/the-page-you-are-requesting-cannot-be-served-because-of-the-extension-configuration.aspx"&gt;http://blogs.msdn.com/rjohri/archive/2009/06/29/the-page-you-are-requesting-cannot-be-served-because-of-the-extension-configuration.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Developing client application and consuming WCF service:&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Create a Console application in Visual Studio:&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;a href="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/StepbystepNtierconfigurationofSyncserv.0_ED0D/clip_image010_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image010" border="0" alt="clip_image010" src="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/StepbystepNtierconfigurationofSyncserv.0_ED0D/clip_image010_thumb.jpg" width="462" height="322" /&gt;&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Once the project is created, reference the dlls&amp;#160; Microsoft.Synchronization.dll, Microsoft.Synchronization.Data.dll, and Microsoft.Synchronization.Data.SqlServerCe.dll as before. You also need to reference System.Data.SqlServerCe.dll (you should have this dll on your machine once you installed SQL Server Compact 3.5 Service Pack 1, location of this dll on my machine: C:\Program Files (x86)\Microsoft SQL Server Compact Edition\v3.5\Desktop as shown below)&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;a href="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/StepbystepNtierconfigurationofSyncserv.0_ED0D/clip_image011_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image011" border="0" alt="clip_image011" src="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/StepbystepNtierconfigurationofSyncserv.0_ED0D/clip_image011_thumb.jpg" width="471" height="311" /&gt;&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Now we need to do service reference to our WCF that we developed and deployed before. Right click on the Reference in this client project and select Add Service Reference…&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;a href="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/StepbystepNtierconfigurationofSyncserv.0_ED0D/clip_image013_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image013" border="0" alt="clip_image013" src="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/StepbystepNtierconfigurationofSyncserv.0_ED0D/clip_image013_thumb.jpg" width="277" height="293" /&gt;&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;In the Add Service Reference screen you type the URL of our WCF and click on Go button as shown below:&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;a href="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/StepbystepNtierconfigurationofSyncserv.0_ED0D/clip_image014_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image014" border="0" alt="clip_image014" src="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/StepbystepNtierconfigurationofSyncserv.0_ED0D/clip_image014_thumb.jpg" width="419" height="353" /&gt;&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Click on “OK” button, it will create service reference as below:&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;a href="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/StepbystepNtierconfigurationofSyncserv.0_ED0D/clip_image016_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image016" border="0" alt="clip_image016" src="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/StepbystepNtierconfigurationofSyncserv.0_ED0D/clip_image016_thumb.jpg" width="299" height="456" /&gt;&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Replace the code in the file Program.cs with the following code:&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;using System;&lt;/p&gt;  &lt;p&gt;using System.IO;&lt;/p&gt;  &lt;p&gt;using System.Data;&lt;/p&gt;  &lt;p&gt;using System.Data.SqlClient;&lt;/p&gt;  &lt;p&gt;using System.Data.SqlServerCe;&lt;/p&gt;  &lt;p&gt;using Microsoft.Synchronization;&lt;/p&gt;  &lt;p&gt;using Microsoft.Synchronization.Data;&lt;/p&gt;  &lt;p&gt;using Microsoft.Synchronization.Data.SqlServerCe;&lt;/p&gt;  &lt;p&gt;namespace ClientForSync&lt;/p&gt;  &lt;p&gt;{&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; class Program&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; static void Main(string[] args)&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //The Utility class handles all functionality that is not&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //directly related to synchronization, such as holding connection &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //string information and making changes to the server database.&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Utility util = new Utility();&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //The SampleStats class handles information from the SyncStatistics&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //object that the Synchronize method returns.&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SampleStats sampleStats = new SampleStats();&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Delete and re-create the database. The client synchronization&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //provider also enables you to create the client database &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //if it does not exist.&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ////util.SetClientPassword();&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; util.RecreateClientDatabase();&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Initial synchronization. Instantiate the SyncAgent&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //and call Synchronize.&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SampleSyncAgent sampleSyncAgent = new SampleSyncAgent();&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SyncStatistics syncStatistics = sampleSyncAgent.Synchronize();&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; sampleStats.DisplayStats(syncStatistics, &amp;quot;initial&amp;quot;);&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Make changes on the server.&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; util.MakeDataChangesOnServer();&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Subsequent synchronization.&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; syncStatistics = sampleSyncAgent.Synchronize();&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; sampleStats.DisplayStats(syncStatistics, &amp;quot;subsequent&amp;quot;);&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Return server data back to its original state.&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; util.CleanUpServer();&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Exit.&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Console.Write(&amp;quot;\nPress Enter to close the window.&amp;quot;);&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Console.ReadLine();&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; //Create a class that is derived from &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; //Microsoft.Synchronization.SyncAgent.&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; public class SampleSyncAgent : SyncAgent&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; public SampleSyncAgent()&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Instantiate a client synchronization provider and specify it&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //as the local provider for this synchronization agent.&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; this.LocalProvider = new SampleClientSyncProvider();&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //The remote provider now references a proxy instead of directly referencing the server provider. The proxy is created by passing a reference to a WCF service&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ServiceReference1.Service1Client serviceProxy = new ServiceReference1.Service1Client();&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; this.RemoteProvider = new ServerSyncProviderProxy(serviceProxy);&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Add the Customer table: specify a synchronization direction of&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //DownloadOnly.&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SyncTable customerSyncTable = new SyncTable(&amp;quot;Customer&amp;quot;);&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; customerSyncTable.CreationOption = TableCreationOption.DropExistingOrCreateNewTable;&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; customerSyncTable.SyncDirection = SyncDirection.DownloadOnly;&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; this.Configuration.SyncTables.Add(customerSyncTable);&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; //Create a class that is derived from &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; //Microsoft.Synchronization.Data.SqlServerCe.SqlCeClientSyncProvider.&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; //You can just instantiate the provider directly and associate it&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; //with the SyncAgent, but you could use this class to handle client &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; //provider events and other client-side processing.&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; public class SampleClientSyncProvider : SqlCeClientSyncProvider&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; public SampleClientSyncProvider()&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Specify a connection string for the sample client database.&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Utility util = new Utility();&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; this.ConnectionString = util.ClientConnString;&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; //Handle the statistics that are returned by the SyncAgent.&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; public class SampleStats&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; public void DisplayStats(SyncStatistics syncStatistics, string syncType)&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Console.WriteLine(String.Empty);&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (syncType == &amp;quot;initial&amp;quot;)&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Console.WriteLine(&amp;quot;****** Initial Synchronization ******&amp;quot;);&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; else if (syncType == &amp;quot;subsequent&amp;quot;)&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Console.WriteLine(&amp;quot;***** Subsequent Synchronization ****&amp;quot;);&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Console.WriteLine(&amp;quot;Start Time: &amp;quot; + syncStatistics.SyncStartTime);&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Console.WriteLine(&amp;quot;Total Changes Downloaded: &amp;quot; + syncStatistics.TotalChangesDownloaded);&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Console.WriteLine(&amp;quot;Complete Time: &amp;quot; + syncStatistics.SyncCompleteTime);&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Console.WriteLine(String.Empty);&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; public class Utility&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Return the client connection string with the password. Don’t forget to create folder&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; public string ClientConnString&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; get { return @&amp;quot;Data Source='D:\\SyncServices\\SyncSampleClient.sdf'; Password=xxxxxxx&amp;quot;; }&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Return the server connection string. &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; public string ServerConnString&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; get { return @&amp;quot;Data Source= SQLServer\instance; Initial Catalog=SyncSamplesDb; User Id=xxxxxx; Password=xxxxxx&amp;quot;; }&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Make server changes that are synchronized on the second &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //synchronization.&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; public void MakeDataChangesOnServer()&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; int rowCount = 0;&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; using (SqlConnection serverConn = new SqlConnection(this.ServerConnString))&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SqlCommand sqlCommand = serverConn.CreateCommand();&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; sqlCommand.CommandText =&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;quot;INSERT INTO Sales.Customer (CustomerName, SalesPerson, CustomerType) &amp;quot; +&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;quot;VALUES ('Cycle Mart', 'James Bailey', 'Retail') &amp;quot; +&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;quot;UPDATE Sales.Customer &amp;quot; +&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;quot;SET&amp;#160; SalesPerson = 'James Bailey' &amp;quot; +&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;quot;WHERE CustomerName = 'Tandem Bicycle Store' &amp;quot; +&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;quot;DELETE FROM Sales.Customer WHERE CustomerName = 'Sharp Bikes'&amp;quot;;&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; serverConn.Open();&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; rowCount = sqlCommand.ExecuteNonQuery();&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; serverConn.Close();&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Console.WriteLine(&amp;quot;Rows inserted, updated, or deleted at the server: &amp;quot; + rowCount);&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Revert changes that were made during synchronization.&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; public void CleanUpServer()&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; using (SqlConnection serverConn = new SqlConnection(this.ServerConnString))&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SqlCommand sqlCommand = serverConn.CreateCommand();&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; sqlCommand.CommandType = CommandType.StoredProcedure;&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; sqlCommand.CommandText = &amp;quot;usp_InsertSampleData&amp;quot;;&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; serverConn.Open();&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; sqlCommand.ExecuteNonQuery();&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; serverConn.Close();&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Delete the client database.&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; public void RecreateClientDatabase()&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; using (SqlCeConnection clientConn = new SqlCeConnection(this.ClientConnString))&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (File.Exists(clientConn.Database))&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; File.Delete(clientConn.Database);&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SqlCeEngine sqlCeEngine = new SqlCeEngine(this.ClientConnString);&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; sqlCeEngine.CreateDatabase();&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;}&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Now we have to update the connection string information in the code. In the Utility class in the below methods you should update the connection string for SQL server and client database (SQL CE database)&lt;/p&gt;  &lt;p&gt;//Return the client connection string with the password. Don’t forget to create folder&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; public string ClientConnString&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; get { return @&amp;quot;Data Source='D:\\SyncServices\\SyncSampleClient.sdf'; Password=xxxxxxx&amp;quot;; }&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Return the server connection string. &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; public string ServerConnString&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; get { return @&amp;quot;Data Source= SQLServer\instance; Initial Catalog=SyncSamplesDb; User Id=xxxxxxx; Password=xxxxxxx&amp;quot;; }&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;Build this client project, at this point the project should compile successfully.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Running/testing synchronization:&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Run the Console application and you should see the result of the synchronization of this sample as below:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/StepbystepNtierconfigurationofSyncserv.0_ED0D/clip_image017_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image017" border="0" alt="clip_image017" src="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/StepbystepNtierconfigurationofSyncserv.0_ED0D/clip_image017_thumb.jpg" width="481" height="280" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;You can run query on the Customer table in SyncSamplesDb to check the changes by setting the break point in the client app and also by opening a SQL profiler you can see the activities going on in SQL Server.&lt;/p&gt;  &lt;p&gt;Happy Synchronization!&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;References:&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Overview (Synchronization Services) : &lt;a href="http://msdn.microsoft.com/en-us/library/bb726031(SQL.90).aspx"&gt;http://msdn.microsoft.com/en-us/library/bb726031(SQL.90).aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Architecture and Classes (Synchronization Services) : &lt;a href="http://msdn.microsoft.com/en-us/library/bb726025(SQL.90).aspx"&gt;http://msdn.microsoft.com/en-us/library/bb726025(SQL.90).aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Getting Started: A Synchronization Services Application: &lt;a href="http://msdn.microsoft.com/en-us/library/bb726015.aspx"&gt;http://msdn.microsoft.com/en-us/library/bb726015.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;How to: Configure N-Tier Synchronization at: &lt;a href="http://msdn.microsoft.com/en-us/library/bb902831.aspx"&gt;http://msdn.microsoft.com/en-us/library/bb902831.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;A large scale implementation of Sync Service example at: &lt;a href="http://blogs.msdn.com/sync/archive/2009/10/19/sharepoint-2010-now-integrates-microsoft-sync-framework.aspx"&gt;http://blogs.msdn.com/sync/archive/2009/10/19/sharepoint-2010-now-integrates-microsoft-sync-framework.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Microsoft Sync Framework 2.0 redistributable Package - &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=109DB36E-CDD0-4514-9FB5-B77D9CEA37F6&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyId=109DB36E-CDD0-4514-9FB5-B77D9CEA37F6&amp;amp;displaylang=en&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Author : Faiz(MSFT), SQL Developer Engineer&lt;/p&gt;  &lt;p&gt;Reviewed by : Enamul(MSFT), SQL Developer Technical Lead; Azim(MSFT), SQL Developer Technical Lead;Srini(MSFT), SQL Developer Engineer&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9998753" width="1" height="1"&gt;</description></item><item><title>How to install/enable .Net 3.5 SP1 on Windows Server 2008 R2 for SQL Server 2008 and SQL Server 2008 R2</title><link>http://blogs.msdn.com/b/sqlblog/archive/2010/01/08/how-to-install-net-framework-3-5-sp1-on-windows-server-2008-r2-environments.aspx</link><pubDate>Sat, 09 Jan 2010 03:26:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9946024</guid><dc:creator>sqlblog</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/sqlblog/rsscomments.aspx?WeblogPostID=9946024</wfw:commentRss><comments>http://blogs.msdn.com/b/sqlblog/archive/2010/01/08/how-to-install-net-framework-3-5-sp1-on-windows-server-2008-r2-environments.aspx#comments</comments><description>&lt;DIV style="COLOR: #000000; FONT-SIZE: small"&gt;The .NET Framework 3.5 SP1 (also referred to as .NET Framework 3.5.1) is a prerequisite for SQL Server 2008. SQL Server 2008 Setup for standalone instance will install the .NET Framework 3.5 SP1 if it is not already installed. In Windows Server 2008 R2, the .NET Framework is a feature and installing it is different when compared to older versions of Windows Operating System. In previous versions, one could either download the .NET Framework 3.5.1 install binaries from Microsoft &lt;A title="" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=ab99342f-5d1a-413d-8319-81da479ab0d7&amp;amp;DisplayLang=en" target="" mce_href="http://www.microsoft.com/downloads/details.aspx?FamilyID=ab99342f-5d1a-413d-8319-81da479ab0d7&amp;amp;DisplayLang=en"&gt;download site &lt;/A&gt;or use the install binaries from the redist folder of the SQL Server 2008 installation media. Starting with Windows Server 2008 R2, the method of installing .NET Framework 3.5.1 has changed. This document explains how to verify that .NET Framework 3.5.1 is installed and if it is not installed how you can add it.&lt;/DIV&gt;
&lt;DIV style="COLOR: #000000; FONT-SIZE: small"&gt;
&lt;H5&gt;&amp;nbsp;&amp;nbsp;&lt;/H5&gt;
&lt;H5&gt;How to verify if .NET Framework 3.5 SP1 is installed:&lt;/H5&gt;
&lt;P&gt;Here are the steps to verify that .NET Framework 3.5.1 is installed on Windows Server 2008 R2.&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Click the &lt;B&gt;Start&lt;/B&gt; button in the lower left hand corner of the display. 
&lt;LI&gt;Highlight &lt;B&gt;Administrative Tools&lt;/B&gt; and select &lt;B&gt;Server Manager&lt;/B&gt;. 
&lt;LI&gt;In the &lt;B&gt;Server Manager&lt;/B&gt; interface, click &lt;B&gt;Features&lt;/B&gt; to display all the installed Features in the right hand pane. Verify that &lt;B&gt;.NET Framework 3.5.1&lt;/B&gt; is listed.&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;If &lt;B&gt;.NET Framework 3.5.1&lt;/B&gt; feature is not listed, you can use either of the following methods to install it:&lt;/P&gt;
&lt;P&gt;&lt;B&gt;Method 1: Using Server Manager Interface&lt;/B&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;In the Server Manager interface, select &lt;B&gt;Add Features &lt;/B&gt;to&lt;B&gt; &lt;/B&gt;displays a list of possible features. 
&lt;LI&gt;In the Select Features interface, expand &lt;B&gt;.NET Framework 3.5.1 Features&lt;/B&gt;. 
&lt;LI&gt;Once you expand &lt;B&gt;.NET Framework 3.5.1 Features&lt;/B&gt;, you will see two check boxes. One &lt;B&gt;for .NET Framework 3.5.1&lt;/B&gt; and other for &lt;B&gt;WCF Activation&lt;/B&gt;. Check the box next to &lt;B&gt;.NET Framework 3.5.1&lt;/B&gt; and click &lt;B&gt;Next&lt;/B&gt;. 
&lt;DL&gt;
&lt;DD&gt;Note: If you do not expand &lt;B&gt;.NET Framework 3.5.1 Features &lt;/B&gt;and check it, you will get a pop-up titled &lt;STRONG&gt;Add Features Wizard&lt;/STRONG&gt;&amp;nbsp; as shown below. 
&lt;DD&gt;Click &lt;STRONG&gt;Cancel &lt;/STRONG&gt;and expand &lt;B&gt;.NET Framework 3.5.1 Features&lt;/B&gt; and then check &lt;B&gt;.NET Framework 3.5.1&lt;/B&gt; check box below it. 
&lt;DD&gt;
&lt;DD&gt;&lt;IMG style="BORDER-BOTTOM: 0px solid; BORDER-LEFT: 0px solid; BORDER-TOP: 0px solid; BORDER-RIGHT: 0px solid" border=0 src="http://support.microsoft.com/library/images/support/kbgraphics/public/en-us/sql/2014321a.jpg" mce_src="http://support.microsoft.com/library/images/support/kbgraphics/public/en-us/sql/2014321a.jpg"&gt;&amp;nbsp; 
&lt;DD&gt;You cannot install .NET Framework 3.5.1 Features unless the required role services and features are also installed.&lt;/DD&gt;&lt;/DL&gt;
&lt;LI&gt;In the &lt;B&gt;Confirm Installation Selections&lt;/B&gt; interface, review the selections and then click &lt;B&gt;Install&lt;/B&gt;. 
&lt;LI&gt;Allow the installation process to complete and then click &lt;B&gt;Close&lt;/B&gt;.&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;&lt;B&gt;Method 2: Using PowerShell&lt;/B&gt;&lt;/P&gt;
&lt;OL style="MARGIN-RIGHT: 0px" dir=ltr&gt;
&lt;LI&gt;Click the &lt;B&gt;Start&lt;/B&gt; button in the lower left hand corner of the display. 
&lt;LI&gt;Highlight &lt;B&gt;All Programs&lt;/B&gt; and select &lt;B&gt;Accessories&lt;/B&gt; 
&lt;LI&gt;Expand Windows PowerShell and right click &lt;B&gt;Windows PowerShell&lt;/B&gt; and select &lt;B&gt;Run as administrator&lt;/B&gt;. Click &lt;B&gt;Yes&lt;/B&gt; on the User Account Control box. 
&lt;LI&gt;At the PowerShell command prompt, type the following commands, and then press ENTER after each command: &lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;B&gt;Import-Module ServerManager&lt;/B&gt; 
&lt;LI&gt;&lt;B&gt;Add-WindowsFeature as-net-framework&lt;/B&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/OL&gt;
&lt;BLOCKQUOTE style="MARGIN-RIGHT: 0px" dir=ltr&gt;
&lt;BLOCKQUOTE style="MARGIN-RIGHT: 0px" dir=ltr&gt;
&lt;P dir=ltr&gt;&lt;STRONG&gt;Note: &lt;/STRONG&gt;A screenshot is shown below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;IMG style="BORDER-BOTTOM: 0px solid; BORDER-LEFT: 0px solid; BORDER-TOP: 0px solid; BORDER-RIGHT: 0px solid" border=0 src="http://support.microsoft.com/library/images/support/kbgraphics/public/en-us/sql/2014321b.jpg" mce_src="http://support.microsoft.com/library/images/support/kbgraphics/public/en-us/sql/2014321b.jpg"&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BLOCKQUOTE&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9946024" width="1" height="1"&gt;</description></item><item><title>Creating HTTP endpoint fails with 7850 error.</title><link>http://blogs.msdn.com/b/sqlblog/archive/2010/01/07/creating-http-endpoint-fails-with-7850-error.aspx</link><pubDate>Thu, 07 Jan 2010 16:19:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9945228</guid><dc:creator>sqlblog</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/sqlblog/rsscomments.aspx?WeblogPostID=9945228</wfw:commentRss><comments>http://blogs.msdn.com/b/sqlblog/archive/2010/01/07/creating-http-endpoint-fails-with-7850-error.aspx#comments</comments><description>&lt;P&gt;&lt;SPAN style="FONT-FAMILY: 'Tahoma','sans-serif'; COLOR: black; FONT-SIZE: 10pt"&gt;Creating a HTTP endpoint in SQL Server 2005 or SQL Server 2008 may fail with the following error messages:&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: red; FONT-SIZE: 10pt"&gt;Msg 7850, Level 16, State 1, Line 1&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Tahoma','sans-serif'; COLOR: red; FONT-SIZE: 10pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: red; FONT-SIZE: 10pt"&gt;The user 'domain\myuser' does not have permission to register endpoint 'training_sql_endpoint' on the specified URL.&amp;nbsp; Please ensure the URL refers to a namespace that is reserved for listening by SQL.&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Tahoma','sans-serif'; COLOR: red; FONT-SIZE: 10pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: red; FONT-SIZE: 10pt"&gt;Msg 7807, Level 16, State 1, Line 1&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Tahoma','sans-serif'; COLOR: red; FONT-SIZE: 10pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: red; FONT-SIZE: 10pt"&gt;An error ('0x80070005') occurred while attempting to register the endpoint 'training_sql_endpoint'.&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Tahoma','sans-serif'; COLOR: red; FONT-SIZE: 10pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT size=3 face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;The error message is actually incorrect in this context, it instead should report that it is the SQL Service account and also direct you to reserve the namespace explicitly, such as (this is what SQL Server 2008 now has):&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; COLOR: red; FONT-SIZE: 10pt; mso-bidi-language: TE"&gt;The SQL Server Service account does not have permission to register the supplied URL on the endpoint '%.*ls'.&amp;nbsp; Use sp_reserve_http_namespace to explicitly reserve the URL namespace before you try to register the URL again.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Tahoma','sans-serif'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: TE"&gt;When you run CREATE ENDPOINT to create a HTTP endpoint, this is done under the context of the SQL Server service account.&amp;nbsp; If the namespace reservation does not already exist, then SQL will implicitly create the reservation.&amp;nbsp; However, this requires that the SQL Server service account have local administrator privileges on the computer. &amp;nbsp;If the SQL Service account does not have local administrator, on SQL Server 2005 it will fail with the message noted earlier.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Tahoma','sans-serif'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: TE"&gt;&amp;nbsp;To resolve this you have two options:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Tahoma','sans-serif'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: TE"&gt;1.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Add the SQL Server service account to the local administrators group, restart and then run the CREATE ENDPOINT again.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Tahoma','sans-serif'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: TE"&gt;2.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Or, explicitly reserve the name space while logged on as a Windows Authentication user that has Local Administrator on the computer and sysadmin on SQL, &amp;nbsp;*before* you run CREATE ENDPOINT.&amp;nbsp; For example:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: TE"&gt;sp_reserve_http_namespace N'http://*:2050/sql/myfolder'&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Tahoma','sans-serif'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: TE"&gt;Then when you run the CREATE ENDPOINT, the SQL Service account will not have to reserve the namespace because it already exists, and proceed with creating the endpoint.&amp;nbsp; Note that when you reserve a namespace explicitly, you need to be sure that the string of the namespace you reserve matches the parameters in the CREATE ENDPOINT statement.&amp;nbsp; So for the namespace above, the CREATE ENDPOINT would need to look like the following for SQL to match it up correctly:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Tahoma','sans-serif'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: TE"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: TE"&gt;CREATE ENDPOINT [myendpoint] &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: TE"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;STATE=STARTED&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: TE"&gt;AS HTTP (PATH=N'/sql/myfolder', PORTS = (CLEAR), AUTHENTICATION = (NTLM, KERBEROS, INTEGRATED), SITE=N'*', CLEAR_PORT = 2050, COMPRESSION=DISABLED)&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Tahoma','sans-serif'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: TE"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Tahoma','sans-serif'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: TE"&gt;The following link has more on this in “Identifying the Namespace for an Endpoint” &lt;A href="http://msdn.microsoft.com/en-us/library/ms190614.aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms190614.aspx"&gt;&lt;SPAN style="COLOR: black; TEXT-DECORATION: none; text-underline: none"&gt;http://msdn.microsoft.com/en-us/library/ms190614.aspx&lt;/SPAN&gt;&lt;/A&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9945228" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/sqlblog/archive/tags/endpoint+7850/">endpoint 7850</category></item><item><title>Tools of the Trade: Part IV - Developing WinDbg Extension DLLs</title><link>http://blogs.msdn.com/b/sqlblog/archive/2009/12/30/tools-of-the-trade-part-iv-developing-windbg-extension-dlls.aspx</link><pubDate>Wed, 30 Dec 2009 18:06:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9942354</guid><dc:creator>sqlblog</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/sqlblog/rsscomments.aspx?WeblogPostID=9942354</wfw:commentRss><comments>http://blogs.msdn.com/b/sqlblog/archive/2009/12/30/tools-of-the-trade-part-iv-developing-windbg-extension-dlls.aspx#comments</comments><description>&lt;P&gt;A WinDbg extension DLL is set of exported callback functions for implementing user defined commands to extract specific customized&amp;nbsp; information from the memory dump(s).&amp;nbsp; Extension DLLs are loaded by debugger engine and can provide extra functionality of automation tasks while performing user-mode or kenrel-mode debugging.&amp;nbsp; An extension DLL may export any number of functions that are used to execute extension commands.&amp;nbsp; Each function is explicitly declared as an export in the&amp;nbsp; DLL's definition file or .def file and function names must be in lowercase letters &lt;/P&gt;
&lt;P&gt;WinDbg (DbgEng ) extension DLL must export &lt;B&gt;DebugExtensionInitialize&lt;/B&gt;. This will be called when the DLL is loaded, to initialize the DLL. It may be used by the DLL to initialize global variables.&lt;/P&gt;
&lt;P&gt;An extension DLL may export an optional function &lt;B&gt;DebugExtensionUninitialize&lt;/B&gt;. If this is exported, it will be called just before the extension DLL is unloaded.&lt;/P&gt;
&lt;P&gt;An extension DLL may export a &lt;B&gt;DebugExtensionNotify&lt;/B&gt;. If this is exported, it will be called when a session begins or ends, and when a target starts or stops executing. These notifications are also provided to &lt;B&gt;IDebugEventCallbacks&lt;/B&gt; objects registered with a client.&lt;/P&gt;
&lt;P&gt;An extension DLL may export &lt;B&gt;KnownStructOutput&lt;/B&gt;. If this is exported, it will be called when the DLL is loaded. This function returns a list of structures that the DLL knows how to print on a single line. It may be called later to format instances of these structures for printing.&lt;/P&gt;
&lt;P&gt;So, how to develop&amp;nbsp;&amp;nbsp; your own Windbg Extension DLL? Lets follow these steps:&lt;/P&gt;
&lt;P&gt;1. Download &amp;amp; Install debugging tools for windows from &lt;A href="http://www.microsoft.com/whdc/devtools/debugging/installx86.Mspx" mce_href="http://www.microsoft.com/whdc/devtools/debugging/installx86.Mspx"&gt;http://www.microsoft.com/whdc/devtools/debugging/installx86.Mspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;2. Create "Win32 Console Application" using VS 2008&lt;/P&gt;
&lt;P&gt;3. Select Application type as "DLL" and click "Finish" . &lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/ToolsoftheTradePartIVDevelopingWinDbgExt_AA0D/Step%203_2.jpg" mce_href="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/ToolsoftheTradePartIVDevelopingWinDbgExt_AA0D/Step%203_2.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="Step 3" border=0 alt="Step 3" src="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/ToolsoftheTradePartIVDevelopingWinDbgExt_AA0D/Step%203_thumb.jpg" width=249 height=208 mce_src="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/ToolsoftheTradePartIVDevelopingWinDbgExt_AA0D/Step%203_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;4. Add a "Module-Definition File (.def)" called "wdbrowser" to the project. One way to export your extension function is by specifying the function names in the EXPORTS section of the .def file. You may you use other ways of exporting functions, such as __dllexport &lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/ToolsoftheTradePartIVDevelopingWinDbgExt_AA0D/Step%204_4.jpg" mce_href="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/ToolsoftheTradePartIVDevelopingWinDbgExt_AA0D/Step%204_4.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="Step 4" border=0 alt="Step 4" src="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/ToolsoftheTradePartIVDevelopingWinDbgExt_AA0D/Step%204_thumb_1.jpg" width=244 height=158 mce_src="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/ToolsoftheTradePartIVDevelopingWinDbgExt_AA0D/Step%204_thumb_1.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;5. Configure the project "Additional include Directories" to point to header files that comes with Windbg. Default folder for x86 is "C:\Program Files\Debugging Tools for Windows (x86)\sdk\inc"&lt;/P&gt;
&lt;P&gt;6. Configure the project "Additional Library Directories" to point to library files that comes with Windbg. Default folder&amp;nbsp; for x86 libraries&amp;nbsp; is&amp;nbsp; ""C:\Program Files\Debugging Tools for Windows (x86)\sdk\lib\i386""&lt;/P&gt;
&lt;P&gt;7. The library, "dbgeng.lib " &amp;amp; "dbgeng.dll" has the implementation of the Debug engine exported functions. So, add "dbgeng.lib" in "Additional Dependencies".&lt;/P&gt;
&lt;P&gt;8. Add name of the module definition file created at the above Step #3&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/ToolsoftheTradePartIVDevelopingWinDbgExt_AA0D/Step%208_2.jpg" mce_href="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/ToolsoftheTradePartIVDevelopingWinDbgExt_AA0D/Step%208_2.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="Step 8" border=0 alt="Step 8" src="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/ToolsoftheTradePartIVDevelopingWinDbgExt_AA0D/Step%208_thumb.jpg" width=244 height=171 mce_src="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/ToolsoftheTradePartIVDevelopingWinDbgExt_AA0D/Step%208_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;9. Now Include the following required headers files in "stdafx.h"&lt;/P&gt;
&lt;P&gt;#include &amp;lt;windows.h&amp;gt;&lt;/P&gt;
&lt;P&gt;#include &amp;lt;imagehlp.h&amp;gt;&lt;/P&gt;
&lt;P&gt;#include &amp;lt;wdbgexts.h&amp;gt;&lt;/P&gt;
&lt;P&gt;#include &amp;lt;dbgeng.h&amp;gt;&lt;/P&gt;
&lt;P&gt;#include &amp;lt;extsfns.h&amp;gt;&lt;/P&gt;
&lt;P&gt;10. Declare following two global variables in your extension project main implementation file.&lt;/P&gt;
&lt;P&gt;//Version.&lt;/P&gt;
&lt;P&gt;EXT_API_VERSION g_ExtApiVersion = {1,1,EXT_API_VERSION_NUMBER,0} ;&lt;/P&gt;
&lt;P&gt;WINDBG_EXTENSION_APIS ExtensionApis = {0};&lt;/P&gt;
&lt;P&gt;11. Declare following debug engine COM interface pointers.&lt;/P&gt;
&lt;P&gt;IDebugAdvanced2*&amp;nbsp; gAdvancedDebug2=NULL;&lt;/P&gt;
&lt;P&gt;IDebugControl4*&amp;nbsp;&amp;nbsp; gDebugControl4=NULL;&lt;/P&gt;
&lt;P&gt;IDebugControl*&amp;nbsp;&amp;nbsp;&amp;nbsp; gExecuteCmd=NULL;&lt;/P&gt;
&lt;P&gt;IDebugClient*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gDebugClient=NULL;&lt;/P&gt;
&lt;P&gt;12. Next step is to declare and implement &lt;B&gt;&lt;I&gt;WinDbgExtensionDllInit &lt;/I&gt;&lt;/B&gt;function in your DLL main implementation source file. In this example that is "wdbrowser.cpp" . The WinDbgExntensionDllInit is the first function that will be called by windbg . So, this function is the idle for implementing any extension specific initialization or related functionality. Please refer &lt;A href="http://msdn.microsoft.com/en-us/library/cc267872.aspx" mce_href="http://msdn.microsoft.com/en-us/library/cc267872.aspx"&gt;http://msdn.microsoft.com/en-us/library/cc267872.aspx&lt;/A&gt; for more details about this function.&lt;/P&gt;
&lt;P&gt;VOID WDBGAPI WinDbgExtensionDllInit (PWINDBG_EXTENSION_APIS lpExtensionApis, USHORT usMajorVersion, USHORT usMinorVersion)&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ExtensionApis = *lpExtensionApis;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HRESULT hResult = S_FALSE;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (hResult = DebugCreate(__uuidof(IDebugClient), (void**) &amp;amp;gDebugClient) != S_OK)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dprintf("Acuqiring IDebugClient* Failled\n\n");&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (hResult = gDebugClient-&amp;gt;QueryInterface(__uuidof(IDebugControl), (void**) &amp;amp;gExecuteCmd) != S_OK)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dprintf("Acuqiring IDebugControl* Failled\n\n");&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (hResult = gDebugClient-&amp;gt;QueryInterface(__uuidof(IDebugAdvanced2), (void**) &amp;amp;gAdvancedDebug2) != S_OK)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dprintf("Acuqiring IDebugAdvanced2* Failled\n\n");&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (hResult = gDebugClient-&amp;gt;QueryInterface(__uuidof(IDebugControl4), (void**) &amp;amp;gDebugControl4) != S_OK)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dprintf("Acuqiring IDebugControl4* Failled\n\n");&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;13. Declare another exported function &lt;B&gt;&lt;I&gt;ExtensionApiVersion&lt;/I&gt;&lt;/B&gt; to report the version of your extension to windbg. Please refer to &lt;A href="http://msdn.microsoft.com/en-us/library/cc267873.aspx" mce_href="http://msdn.microsoft.com/en-us/library/cc267873.aspx"&gt;http://msdn.microsoft.com/en-us/library/cc267873.aspx&lt;/A&gt; for detailed information about this function.&lt;/P&gt;
&lt;P&gt;LPEXT_API_VERSION WDBGAPI ExtensionApiVersion (void)&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return &amp;amp;g_ExtApiVersion;&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&lt;B&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;14. Define Debug engine's interface pointers, so that your extension module can interact with debug engine. For more information please refer &lt;/P&gt;
&lt;P&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/cc265976.aspx" mce_href="http://msdn.microsoft.com/en-us/library/cc265976.aspx"&gt;http://msdn.microsoft.com/en-us/library/cc265976.aspx&lt;/A&gt;&amp;nbsp; - IDebugClient, &lt;A href="http://msdn.microsoft.com/en-us/library/cc266102.aspx" mce_href="http://msdn.microsoft.com/en-us/library/cc266102.aspx"&gt;http://msdn.microsoft.com/en-us/library/cc266102.aspx&lt;/A&gt; - IDebugControl&lt;/P&gt;
&lt;P&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/cc265957.aspx" mce_href="http://msdn.microsoft.com/en-us/library/cc265957.aspx"&gt;http://msdn.microsoft.com/en-us/library/cc265957.aspx&lt;/A&gt; - IDebugAdvanced&lt;/P&gt;
&lt;P&gt;IDebugAdvanced2* gAdvancedDebug2=NULL;&lt;/P&gt;
&lt;P&gt;IDebugControl4* gDebugControl4=NULL;&lt;/P&gt;
&lt;P&gt;IDebugControl* gExecuteCmd=NULL;&lt;/P&gt;
&lt;P&gt;IDebugClient*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gDebugClient=NULL;&lt;/P&gt;
&lt;P&gt;15. Next step is to - implement debug engine's callback interface &lt;B&gt;&lt;I&gt;IDebugOutputCallbacks&lt;/I&gt;&lt;/B&gt; . Debug engine callbacks your implementation of IDebugOutCallbacks::Output() with output as a result of the commands that are executed by your extension function.&lt;/P&gt;
&lt;P&gt;Refer to &lt;A href="http://msdn.microsoft.com/en-us/library/cc265716.aspx" mce_href="http://msdn.microsoft.com/en-us/library/cc265716.aspx"&gt;http://msdn.microsoft.com/en-us/library/cc265716.aspx&lt;/A&gt;&amp;nbsp;&amp;nbsp; for detailed information about IDebugOutputCallbacks::Output() &lt;/P&gt;
&lt;P&gt;16. Add the following new class in a header file that inherits the &lt;B&gt;&lt;I&gt;IDebugOutputCallbacks&lt;/I&gt;&lt;/B&gt; interface .&lt;/P&gt;
&lt;P&gt;#ifndef __OUT_HPP__&lt;/P&gt;
&lt;P&gt;#define __OUT_HPP__&lt;/P&gt;
&lt;P&gt;#include &amp;lt;string&amp;gt;&lt;/P&gt;
&lt;P&gt;#include &amp;lt;sstream&amp;gt;&lt;/P&gt;
&lt;P&gt;class StdioOutputCallbacks : public IDebugOutputCallbacks&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;private:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; std::string m_OutputBuffer;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //This buffer holds the output from the command execution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CHAR m_OutPutBuffer[4096];&lt;/P&gt;
&lt;P&gt;public:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; void InitOutPutBuffer();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; std::string GetOutputBuffer() &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return m_OutputBuffer; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; void ClearOutPutBuffer()&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_OutputBuffer = "";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; STDMETHOD(QueryInterface)(&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; THIS_&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IN REFIID InterfaceId,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OUT PVOID* Interface&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; );&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; STDMETHOD_(ULONG, AddRef)(&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; THIS&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; );&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; STDMETHOD_(ULONG, Release)(&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; THIS&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; );&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // IDebugOutputCallbacks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; STDMETHOD(Output)(&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; THIS_&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IN ULONG Mask,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IN PCSTR Text&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; );&lt;/P&gt;
&lt;P&gt;};&lt;/P&gt;
&lt;P&gt;extern StdioOutputCallbacks g_OutputCb;&lt;/P&gt;
&lt;P&gt;#endif // #ifndef __OUT_HPP__&lt;/P&gt;
&lt;P&gt;17. Add the following code that implements the &lt;B&gt;&lt;I&gt;IDebugOutputCallbacks &lt;/I&gt;&lt;/B&gt;interface methods, especially Output()&lt;/P&gt;
&lt;P&gt;#include "stdafx.h"&lt;/P&gt;
&lt;P&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/P&gt;
&lt;P&gt;#include &amp;lt;windows.h&amp;gt;&lt;/P&gt;
&lt;P&gt;#include &amp;lt;dbgeng.h&amp;gt;&lt;/P&gt;
&lt;P&gt;#include "OutputCallBack.h"&lt;/P&gt;
&lt;P&gt;StdioOutputCallbacks g_OutputCb;&lt;/P&gt;
&lt;P&gt;STDMETHODIMP&lt;/P&gt;
&lt;P&gt;StdioOutputCallbacks::QueryInterface(&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; THIS_&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IN REFIID InterfaceId,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; OUT PVOID* Interface&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; *Interface = NULL;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (IsEqualIID(InterfaceId, __uuidof(IUnknown)) ||&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IsEqualIID(InterfaceId, __uuidof(IDebugOutputCallbacks)))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *Interface = (IDebugOutputCallbacks *)this;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AddRef();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return S_OK;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return E_NOINTERFACE;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;STDMETHODIMP_(ULONG)&lt;/P&gt;
&lt;P&gt;StdioOutputCallbacks::AddRef(&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; THIS&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // This class is designed to be static so&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // there's no true refcount.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 1;&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;STDMETHODIMP_(ULONG)&lt;/P&gt;
&lt;P&gt;StdioOutputCallbacks::Release(&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; THIS&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // This class is designed to be static so&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // there's no true refcount.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 0;&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;STDMETHODIMP&lt;/P&gt;
&lt;P&gt;StdioOutputCallbacks::Output(&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; THIS_&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IN ULONG Mask,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IN PCSTR Text&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; UNREFERENCED_PARAMETER(Mask);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_OutputBuffer += Text;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return S_OK;&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;void StdioOutputCallbacks::InitOutPutBuffer()&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_OutputBuffer.erase();&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;18. Add implementation of your extension function. In this example, we choose to implement an extension that displays the variable names, types in the frame 2 of the current thread. The implementation is:&lt;/P&gt;
&lt;P&gt;DECLARE_API (dvf3)&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;//&lt;/P&gt;
&lt;P&gt;// Install output callbacks.&lt;/P&gt;
&lt;P&gt;//&lt;/P&gt;
&lt;P&gt;if ((gDebugClient-&amp;gt;SetOutputCallbacks((PDEBUG_OUTPUT_CALLBACKS) &amp;amp;g_OutputCb))!= S_OK)&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;dprintf("*****Error while installing Outputcallback.*****\n\n");&lt;/P&gt;
&lt;P&gt;return;&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;//&lt;/P&gt;
&lt;P&gt;// Since frame count starts from 0 index, we have to pass 2 as parameter for .frame command for the frame# 2&lt;/P&gt;
&lt;P&gt;//&lt;/P&gt;
&lt;P&gt;//Execute command to extrac 2nd frame.&lt;/P&gt;
&lt;P&gt;if (gExecuteCmd-&amp;gt;Execute(DEBUG_OUTCTL_THIS_CLIENT | //Send output to only outputcallbacks &lt;/P&gt;
&lt;P&gt;DEBUG_OUTCTL_OVERRIDE_MASK | &lt;/P&gt;
&lt;P&gt;DEBUG_OUTCTL_NOT_LOGGED,&lt;/P&gt;
&lt;P&gt;".frame 2", &lt;/P&gt;
&lt;P&gt;DEBUG_EXECUTE_DEFAULT ) != S_OK)&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;dprintf("Executing .frame 2 failled\n");&lt;/P&gt;
&lt;P&gt;return;&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;//Execute command to extrac 2nd frame.&lt;/P&gt;
&lt;P&gt;if (gExecuteCmd-&amp;gt;Execute(DEBUG_OUTCTL_THIS_CLIENT | //Send output to only outputcallbacks &lt;/P&gt;
&lt;P&gt;DEBUG_OUTCTL_OVERRIDE_MASK | &lt;/P&gt;
&lt;P&gt;DEBUG_OUTCTL_NOT_LOGGED,&lt;/P&gt;
&lt;P&gt;"dv /i /t /v", &lt;/P&gt;
&lt;P&gt;DEBUG_EXECUTE_DEFAULT ) != S_OK)&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;dprintf("Executing dv /i /t /v failled\n");&lt;/P&gt;
&lt;P&gt;return;&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;dprintf("***** Extracting locals &amp;amp; formal params from frame 2 *****");&lt;/P&gt;
&lt;P&gt;dprintf("\n%s\n", g_OutputCb.GetOutputBuffer().c_str());&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;19. Re-build the project. Copy the .DLL from release folder to a folder where Windbg looks for extension DLLs. &lt;/P&gt;
&lt;P&gt;On x86 machine default location is&amp;nbsp; "&amp;lt;Drive letter&amp;gt;\Program Files\Debugging Tools for Windows (x86)\winext"&lt;/P&gt;
&lt;P&gt;20. The extension is ready for the use or test.&lt;/P&gt;
&lt;P&gt;21. Start windbg and open a full user mode dump. Type .load myextension and hit enter to load the extension DLL into Windbg process space&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/ToolsoftheTradePartIVDevelopingWinDbgExt_AA0D/Step21_2.jpg" mce_href="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/ToolsoftheTradePartIVDevelopingWinDbgExt_AA0D/Step21_2.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=Step21 border=0 alt=Step21 src="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/ToolsoftheTradePartIVDevelopingWinDbgExt_AA0D/Step21_thumb.jpg" width=244 height=64 mce_src="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/ToolsoftheTradePartIVDevelopingWinDbgExt_AA0D/Step21_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;22. Run .chain command to verify if your extension is loaded by WinDbg . you will see output similar to below output, if your extension is loaded.&lt;/P&gt;
&lt;P&gt;23. Type !dvf3 to run the extension function for extracting and displaying variable names, types from the frame 2 . &lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/ToolsoftheTradePartIVDevelopingWinDbgExt_AA0D/Step23_2.jpg" mce_href="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/ToolsoftheTradePartIVDevelopingWinDbgExt_AA0D/Step23_2.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=Step23 border=0 alt=Step23 src="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/ToolsoftheTradePartIVDevelopingWinDbgExt_AA0D/Step23_thumb.jpg" width=244 height=95 mce_src="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/ToolsoftheTradePartIVDevelopingWinDbgExt_AA0D/Step23_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Additional references:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/cc265826.aspx" mce_href="http://msdn.microsoft.com/en-us/library/cc265826.aspx"&gt;http://msdn.microsoft.com/en-us/library/cc265826.aspx&lt;/A&gt; - describes about how to Interact with debug engine, I/O operations with debug engine, Memory access, Using symbols, source files.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.codeplex.com/ODbgExt" mce_href="http://www.codeplex.com/ODbgExt"&gt;http://www.codeplex.com/ODbgExt&lt;/A&gt;&amp;nbsp; - Microsoft Open Debugger Extension for Windbg&lt;/P&gt;
&lt;P&gt;Happy developing debug engine extensions!&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Posted By: Srini Gajjela &amp;amp; &lt;/STRONG&gt;&lt;STRONG&gt;Enamul Khaleque (DSD-SQLDeveloper group @ Microsoft)&lt;/STRONG&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9942354" width="1" height="1"&gt;</description></item><item><title>How to connect to file-based data sources (Microsoft Access , Microsoft Excel and Text files ) from a 64 bit application</title><link>http://blogs.msdn.com/b/sqlblog/archive/2009/12/29/how-to-connect-to-file-based-data-sources-microsoft-access-microsoft-excel-and-text-files-from-a-64-bit-application.aspx</link><pubDate>Tue, 29 Dec 2009 15:50:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9941953</guid><dc:creator>sqlblog</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/sqlblog/rsscomments.aspx?WeblogPostID=9941953</wfw:commentRss><comments>http://blogs.msdn.com/b/sqlblog/archive/2009/12/29/how-to-connect-to-file-based-data-sources-microsoft-access-microsoft-excel-and-text-files-from-a-64-bit-application.aspx#comments</comments><description>&amp;nbsp; 
&lt;P style="MARGIN: 0in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt; FONT-WEIGHT: bold"&gt;The Issue:&lt;/P&gt;
&lt;P style="MARGIN: 0in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt"&gt;A 64-bit process can load only 64-bit components in it's process boundary. Same is true for a 32-bit process also. So, if your application is 64 bit, you will need a 64-bit provider or driver to connect to&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Microsoft Access (mdb, accdb) or Microsoft Excel 2010 (xls, xlsx, and xlsb) or&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;text files. Bad news is that there is no 64-bit provider or driver available "yet" to connect to these file-based data sources. Good news is that a 64-bit Provider is heading your way which is currently in beta phase.&lt;/P&gt;
&lt;P style="MARGIN: 0in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt; FONT-WEIGHT: bold" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt; FONT-WEIGHT: bold"&gt;The Kludge:&lt;/P&gt;
&lt;P style="MARGIN: 0in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt"&gt;The common workaround is to connect to a 32-bit SQL Server instance that has a Linked Server to the Access/Excel/Text file. This is a hack, can be difficult to get set-up, and can have stability and performance issues, and realistically, we at Microsoft would rather not support this setup or issues arising from it.&lt;/P&gt;
&lt;P style="MARGIN: 0in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt; FONT-WEIGHT: bold"&gt;The Good news:&lt;/P&gt;
&lt;P style="MARGIN: 0in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;A&lt;/SPAN&gt; 64-bit driver is headed your way. This is great news for users in a 64-bit world. Soon you'll be able to connect to these file-based data sources from your 64-bit application, rather than wrestle with obscure settings to force them to connect via a Linked Server.&lt;/P&gt;
&lt;P style="MARGIN: 0in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt"&gt;The next version of Microsoft Office, Office 2010, will be available in a 64-bit version. This version will include a 64-bit version of "2010 Office System Driver Connectivity Components" which will include all the needed 64-bit ODBC driver and OLEDB providers to connect to these file-based data sources.&lt;/P&gt;
&lt;P style="MARGIN: 0in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt"&gt;You will not have to buy or install Office 2010 to obtain and use the new 64-bit components. Like the current version of the provider, it will be available as a free download. &lt;/P&gt;
&lt;P style="MARGIN: 0in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt"&gt;You can download the beta version from here:&lt;/P&gt;
&lt;P style="MARGIN: 0in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt"&gt;&lt;A href="http://www.microsoft.com/downloads/details.aspx?familyid=C06B8369-60DD-4B64-A44B-84B371EDE16D&amp;amp;displaylang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?familyid=C06B8369-60DD-4B64-A44B-84B371EDE16D&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?familyid=C06B8369-60DD-4B64-A44B-84B371EDE16D&amp;amp;displaylang=en&lt;/A&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt; FONT-WEIGHT: bold" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt; FONT-WEIGHT: bold"&gt;Connection string for 64-bit OLEDB Provider: &lt;/P&gt;
&lt;UL style="MARGIN-TOP: 0in; unicode-bidi: embed; DIRECTION: ltr; MARGIN-BOTTOM: 0in; MARGIN-LEFT: 0.75in" type=disc&gt;
&lt;LI style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle"&gt;&lt;SPAN style="FONT-FAMILY: Verdana; FONT-SIZE: 10pt"&gt;For Microsoft Office Access : Set the Provider string to “Microsoft.ACE.OLEDB.12.0"&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle"&gt;&lt;SPAN style="FONT-FAMILY: Verdana; FONT-SIZE: 10pt"&gt;For Microsoft Office Excel&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;: Add “Excel 12.0” to the Extended Properties of the OLEDB connection string. &lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P style="MARGIN: 0in 0in 0in 0.75in; FONT-FAMILY: Verdana; FONT-SIZE: 10pt" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt; FONT-WEIGHT: bold"&gt;Connection string for 64-bit ODBC Driver:&lt;/P&gt;
&lt;UL style="MARGIN-TOP: 0in; unicode-bidi: embed; DIRECTION: ltr; MARGIN-BOTTOM: 0in; MARGIN-LEFT: 0.75in" type=disc&gt;
&lt;LI style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle"&gt;&lt;SPAN style="FONT-FAMILY: Verdana; FONT-SIZE: 10pt"&gt;For Microsoft Office Access: Set the Connection String to “Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=path to mdb/accdb file” &lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle"&gt;&lt;SPAN style="FONT-FAMILY: Verdana; FONT-SIZE: 10pt"&gt;For Microsoft Office Excel: Set the Connection String to “Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ=path to xls/xlsx/xlsm/xlsb file” &lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P style="MARGIN: 0in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt; FONT-WEIGHT: bold" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt; FONT-WEIGHT: bold"&gt;The gotchas:&lt;/P&gt;
&lt;UL style="MARGIN-TOP: 0in; unicode-bidi: embed; DIRECTION: ltr; MARGIN-BOTTOM: 0in; MARGIN-LEFT: 0.75in" type=disc&gt;
&lt;LI style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle"&gt;&lt;SPAN style="FONT-FAMILY: Calibri; FONT-SIZE: 11pt"&gt;You cannot install the 32-bit version and the 64-bit version of the "2010 Office System Driver Connectivity Components" on the same computer.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle"&gt;&lt;SPAN style="FONT-FAMILY: Calibri; FONT-SIZE: 11pt"&gt;You cannot install the 64-bit version of the "2010 Office System Driver Connectivity Components" on a computer that already has the 32-bit Office 2007 ACE Provider. However, the 32-bit Office 2007 provider can coexist side-by-side with the 32-bit version of the "2010 Office System Driver Connectivity Components".&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle"&gt;&lt;SPAN style="FONT-FAMILY: Calibri; FONT-SIZE: 11pt"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle"&gt;&lt;STRONG&gt;&lt;SPAN style="FONT-FAMILY: Calibri; FONT-SIZE: 11pt"&gt;Authors:&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Calibri; FONT-SIZE: 11pt"&gt;Enamul Khaleque &amp;amp; Srini Gajjela &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Calibri; FONT-SIZE: 11pt"&gt;[DSD-SQLDeveloper group at Microsoft]&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle"&gt;&lt;SPAN style="FONT-FAMILY: Calibri; FONT-SIZE: 11pt"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9941953" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/sqlblog/archive/tags/SQL+Tips+and+Tricks/">SQL Tips and Tricks</category><category domain="http://blogs.msdn.com/b/sqlblog/archive/tags/SQL+Connectivity/">SQL Connectivity</category><category domain="http://blogs.msdn.com/b/sqlblog/archive/tags/64+bit+ACE+provider/">64 bit ACE provider</category><category domain="http://blogs.msdn.com/b/sqlblog/archive/tags/64+bit+JET+driver/">64 bit JET driver</category><category domain="http://blogs.msdn.com/b/sqlblog/archive/tags/64+bit+JET+Provider/">64 bit JET Provider</category></item><item><title>SQL Server 2005 setup fails when MSXML Core Services 6.0 Service Pack 2 has already been installed</title><link>http://blogs.msdn.com/b/sqlblog/archive/2009/08/28/sql-server-2005-setup-fails-when-msxml-core-services-6-0-service-pack-2-has-already-been-installed.aspx</link><pubDate>Fri, 28 Aug 2009 19:26:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9888616</guid><dc:creator>sqlblog</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/sqlblog/rsscomments.aspx?WeblogPostID=9888616</wfw:commentRss><comments>http://blogs.msdn.com/b/sqlblog/archive/2009/08/28/sql-server-2005-setup-fails-when-msxml-core-services-6-0-service-pack-2-has-already-been-installed.aspx#comments</comments><description>&lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 13pt; color: black; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;&lt;font size="2"&gt;There is a known issue with SQL Server setup when MSXML6 component update has been installed on the system. The problem described in &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 13pt; color: black; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;KB 968749 &lt;/font&gt;&lt;a href="http://support.microsoft.com/kb/968749"&gt;&lt;font color="#0000ff" size="2"&gt;http://support.microsoft.com/kb/968749&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt; has raised a lot of concerns by customers. The concerns are related to the fact that the solution is manual and not usable in a Large Enterprise environments. In order to automate MSXML6 component un-install we have created the automatic solution for this issue. However the solution needs to be implemented on a case by case basis.         &lt;p&gt;&lt;/p&gt;       &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 13pt; color: black; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;     &lt;p&gt;&lt;font size="2"&gt;&amp;#160;&lt;/font&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 13pt; color: black; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;&lt;font size="2"&gt;If you are experiencing the issue described in KB 968749 and need an automated solution for this, please contact SQL CSS. &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 13pt; color: black; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;&lt;font size="2"&gt;Please see details on how to open the incident here &lt;/font&gt;&lt;a href="http://support.microsoft.com/"&gt;&lt;font color="#0000ff" size="2"&gt;http://support.microsoft.com/&lt;/font&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 13pt; color: black; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;&lt;font size="2"&gt;The incident for this specific issue is going to be free of charge.       &lt;p&gt;&lt;/p&gt;     &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 13pt; color: black; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;     &lt;p&gt;&lt;font size="2"&gt;&amp;#160;&lt;/font&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 13pt; color: black; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;&lt;font size="2"&gt;We apologize for any inconvenience.       &lt;p&gt;&lt;/p&gt;     &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 13pt; color: black; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;     &lt;p&gt;&lt;font size="2"&gt;&amp;#160;&lt;/font&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 13pt; color: black; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;&lt;font size="2"&gt;SQL CSS.       &lt;p&gt;&lt;/p&gt;     &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Follow us on twitter (&lt;a href="http://twitter.com/MicrosoftSQLCSS"&gt;&lt;font color="#0000ff"&gt;http://twitter.com/MicrosoftSQLCSS&lt;/font&gt;&lt;/a&gt;)&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9888616" width="1" height="1"&gt;</description></item><item><title>How to configure SQL server to listen on different ports on different IP addresses?</title><link>http://blogs.msdn.com/b/sqlblog/archive/2009/07/17/how-to-configure-sql-server-to-listen-on-different-ports-on-different-ip-addresses.aspx</link><pubDate>Sat, 18 Jul 2009 00:17:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9837916</guid><dc:creator>sqlblog</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/sqlblog/rsscomments.aspx?WeblogPostID=9837916</wfw:commentRss><comments>http://blogs.msdn.com/b/sqlblog/archive/2009/07/17/how-to-configure-sql-server-to-listen-on-different-ports-on-different-ip-addresses.aspx#comments</comments><description>&lt;DIV style="PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; DISPLAY: inline; FLOAT: none; PADDING-TOP: 0px" id=scid:0767317B-992E-4b12-91E0-4F059A8CECA8:4afd4af7-7a93-44a6-ae21-a50e4d1ea5b5 class=wlWriterEditableSmartContent&gt;Technorati Tags: &lt;A href="http://technorati.com/tags/SQL+Port" rel=tag mce_href="http://technorati.com/tags/SQL+Port"&gt;SQL Port&lt;/A&gt;&lt;/DIV&gt;
&lt;P&gt;The following post describes how you can configure your SQL Server to listen on a different port(s) on different IP addresses that are available on your system. This procedure applies to both SQL server 2005 and SQL server 2008.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Case 1&lt;/STRONG&gt;: SQL Server is installed in an environment where the IP addresses had not changed since the time it is originally installed.&lt;/P&gt;
&lt;P&gt;1) Open SQL Server configuration manager.&lt;/P&gt;
&lt;P&gt;2) Ensure that TCP/IP protocol is enabled&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/HowtoconfigureSQLservertolistenondiffere_FA7D/image_2.png" mce_href="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/HowtoconfigureSQLservertolistenondiffere_FA7D/image_2.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=image border=0 alt=image src="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/HowtoconfigureSQLservertolistenondiffere_FA7D/image_thumb.png" width=321 height=91 mce_src="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/HowtoconfigureSQLservertolistenondiffere_FA7D/image_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;By default, all the IP addresses listen the same port or ports configured in SQL Server configuration manager. The SQL Server error log will have an entry like the following:&lt;/P&gt;
&lt;P&gt;2009-07-15 17:40:06.39 Server&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Server is listening on [ 'any' &amp;lt;ipv4&amp;gt; 2675].&lt;/P&gt;
&lt;P&gt;3) In the TCP/IP properties set ‘Listen All’ to ‘No’&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/HowtoconfigureSQLservertolistenondiffere_FA7D/image_4.png" mce_href="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/HowtoconfigureSQLservertolistenondiffere_FA7D/image_4.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=image border=0 alt=image src="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/HowtoconfigureSQLservertolistenondiffere_FA7D/image_thumb_1.png" width=310 height=160 mce_src="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/HowtoconfigureSQLservertolistenondiffere_FA7D/image_thumb_1.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;4) Go to the IP addresses tab for the instance, set &lt;STRONG&gt;Enabled&lt;/STRONG&gt; to Yes and &lt;STRONG&gt;TCP port number&lt;/STRONG&gt; field for the specific IP address to the desired &lt;/P&gt;
&lt;P&gt;port. The screen will look as follows:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/HowtoconfigureSQLservertolistenondiffere_FA7D/image_10.png" mce_href="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/HowtoconfigureSQLservertolistenondiffere_FA7D/image_10.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=image border=0 alt=image src="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/HowtoconfigureSQLservertolistenondiffere_FA7D/image_thumb_4.png" width=246 height=274 mce_src="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/HowtoconfigureSQLservertolistenondiffere_FA7D/image_thumb_4.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;5) Restart the SQL Server. Now you should see an entry similar to the following in the SQL error log:&lt;/P&gt;
&lt;P&gt;2009-07-15 18:03:10.58 Server&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Server is listening on [ x.y.z.w &amp;lt;ipv4&amp;gt; 2000]. &lt;BR&gt;2009-07-15 18:03:10.59 Server&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Server is listening on [ x.y.z.v &amp;lt;ipv4&amp;gt; 2001].&lt;/P&gt;
&lt;P&gt;As you can see from the above each of the IP addresses is listening on different port.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Case 2&lt;/STRONG&gt;: SQL Server is installed in an environment where the IP addresses change dynamically, but the number of IPs active on the system are the same (For example there are two IPs active on the system, but because of lease expiry or when moving to a new subnet, the system hosting SQL Server got either one or both of its IPs changed). In this case, get the output of ipconfig /all on the system, and edit one or all the IP addresses as needed with the new IP addresses that are active on the system using a similar procedure discussed in &lt;STRONG&gt;Case 1&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Case 3&lt;/STRONG&gt;: You add an additional IP address on the system:&lt;/P&gt;
&lt;P&gt;In that scenario, you will not be able to use the procedure documented in &lt;STRONG&gt;Case 1&lt;/STRONG&gt;&amp;nbsp; or &lt;STRONG&gt;Case 2 &lt;/STRONG&gt;above as the Configuration Manager’s IP address list will just only have as many entries as the number of IPs that SQL Server found when it is installed &lt;/P&gt;
&lt;P&gt;In this scenario, you can take the following steps to update the registry values SQL server looks at to listen on different ports on different IP addresses.&lt;/P&gt;
&lt;P&gt;&lt;B&gt;Warning &lt;/B&gt;Serious problems might occur if you modify the registry incorrectly by using Registry Editor or by using another method. These problems might require that you reinstall your operating system. Microsoft cannot guarantee that these problems can be solved. Modify the registry at your own risk. . For more information about how to back up, restore, and modify the registry, click the following article number to view the article in the Microsoft Knowledge Base: &lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.microsoft.com/?id=322756" mce_href="http://support.microsoft.com/?id=322756"&gt;322756&lt;/A&gt; How to back up and restore the registry in Windows &lt;/P&gt;
&lt;P&gt;1) Navigate to the following registry key on the SQL server machine:&lt;/P&gt;
&lt;P&gt;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\&lt;FONT color=#ff0000&gt;!INSTANCEID!&lt;/FONT&gt;\MSSQLServer\SuperSocketNetLib\Tcp\&lt;/P&gt;
&lt;P&gt;Note: !INSTANCEID! is a place holder for your SQL server instance.&lt;/P&gt;
&lt;P&gt;2) Right click on IP1, export the registry key as SQLIP template.reg&lt;/P&gt;
&lt;P&gt;3) Edit the&amp;nbsp; key name and IP address key .reg file that you exported in step 2 with notepad with the new IP address. (You can get the IP address list on the system by executing &lt;EM&gt;&lt;FONT color=#000080&gt;ipconfig /all &amp;gt; ipconfig.txt&lt;/FONT&gt;&lt;/EM&gt; command from the command prompt).&lt;/P&gt;
&lt;P&gt;The contents would look as follows:&lt;/P&gt;
&lt;P&gt;Windows Registry Editor Version 5.00 &lt;/P&gt;
&lt;P&gt;[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL10.SQL10\MSSQLServer\SuperSocketNetLib\Tcp\&lt;STRONG&gt;&lt;FONT color=#800000&gt;IP3&lt;/FONT&gt;&lt;/STRONG&gt;]—&amp;gt; &lt;FONT color=#ff0000&gt;Change this name to a new value for example &lt;STRONG&gt;IP4&lt;/STRONG&gt; &lt;BR&gt;&lt;/FONT&gt;"Enabled"=dword:00000000 &lt;BR&gt;"Active"=dword:00000001 &lt;BR&gt;"TcpPort"="2001" &lt;BR&gt;"TcpDynamicPorts"="" &lt;BR&gt;"DisplayName"="Specific IP Address" &lt;BR&gt;&lt;STRONG&gt;&lt;FONT color=#008000&gt;"IpAddress"="a.b.c.d" –&amp;gt; Update this with new IP address value&lt;/FONT&gt;&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;4) After editing the file save it with a different name – for example &lt;EM&gt;new IP4.reg&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;5) Double click the .reg file from step 3 to import the key as a new entry under [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL10.SQL10\MSSQLServer\SuperSocketNetLib\Tcp] registry entry.&lt;/P&gt;
&lt;P&gt;6) Repeat steps (3),(4) and (5) for any other new IP addresses that you currently want to configure on the system.&lt;/P&gt;
&lt;P&gt;Note: After adding the above registry keys, the new IP addresses should now show up in SQL server configuration manager.&lt;/P&gt;
&lt;P&gt;7) &lt;STRONG&gt;Optional&lt;/STRONG&gt;: Clean up any IPs that are no longer active by deleting the associated &amp;lt;IP_n&amp;gt; registry keys.&lt;/P&gt;
&lt;P&gt;8) In SQL Server configuration manager, IP addresses tab, ensure that only the addresses that are listed in the ipconfig output on the system have &lt;STRONG&gt;Enabled&lt;/STRONG&gt; property set to Yes and the other set to No&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/HowtoconfigureSQLservertolistenondiffere_FA7D/image_12.png" mce_href="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/HowtoconfigureSQLservertolistenondiffere_FA7D/image_12.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=image border=0 alt=image src="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/HowtoconfigureSQLservertolistenondiffere_FA7D/image_thumb_5.png" width=269 height=293 mce_src="http://blogs.msdn.com/blogfiles/sqlblog/WindowsLiveWriter/HowtoconfigureSQLservertolistenondiffere_FA7D/image_thumb_5.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Note: If IP All is set to No and if the IP addresses tab has some IP addresses that have ‘Enabled’ set to ‘Yes’ but the actual IP is no longer active on the system, SQL Server service fails to start with an error message like the following logged to SQL Server error log:&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#ff0000&gt;2009-07-16 15:43:07.87 Server&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Server is listening on [ 127.0.0.1 &amp;lt;ipv4&amp;gt; 2753]. &lt;BR&gt;2009-07-16 15:43:07.89 Server&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Error: 26024, Severity: 16, State: 1. &lt;BR&gt;2009-07-16 15:43:07.89 Server&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Server failed to listen on x.y.z,w &amp;lt;ipv4&amp;gt; 2000. Error: 0x2741. To proceed, notify your system administrator. &lt;BR&gt;2009-07-16 15:43:07.95 Server&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Error: 17182, Severity: 16, State: 1. &lt;BR&gt;2009-07-16 15:43:07.95 Server&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TDSSNIClient initialization failed with error 0x2741, status code 0xa. Reason: Unable to initialize the TCP/IP listener. The requested address is not valid in its context. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#ff0000&gt;2009-07-16 15:43:07.95 Server&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Error: 17182, Severity: 16, State: 1. &lt;BR&gt;2009-07-16 15:43:07.95 Server&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TDSSNIClient initialization failed with error 0x2741, status code 0x1. Reason: Initialization failed with an infrastructure error. Check for previous errors. The requested address is not valid in its context. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#ff0000&gt;2009-07-16 15:43:07.95 Server&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Error: 17826, Severity: 18, State: 3. &lt;BR&gt;2009-07-16 15:43:07.95 Server&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Could not start the network library because of an internal error in the network library. To determine the cause, review the errors immediately preceding this one in the error log. &lt;BR&gt;2009-07-16 15:43:07.95 Server&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Error: 17120, Severity: 16, State: 1. &lt;BR&gt;2009-07-16 15:43:07.95 Server&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SQL Server could not spawn FRunCM thread. Check the SQL Server error log and the Windows event logs for information about possible related problems.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Case 4&lt;/STRONG&gt;: SQL Server is installed in a clustered environment.&lt;/P&gt;
&lt;P&gt;On cluster, you cannot configure SQL Server to listen on a specific IP addresses. You must chose IPALL. The IP addresses on which the cluster instance will be listening on is determined by cluster resources (configurable through Cluster Administrator, by adding IP Address resources under SQL Network Name resource).&lt;/P&gt;
&lt;P&gt;Additional links:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/ms177440.aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms177440.aspx"&gt;How to: Configure a Server to Listen on a Specific TCP Port (SQL Server Configuration Manager)&lt;/A&gt; &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;294453" mce_href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;294453"&gt;294453&lt;/A&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; How to set up SQL Server to listen on multiple static TCP ports &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;823938" mce_href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;823938"&gt;823938&lt;/A&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; How to configure an instance of SQL Server to listen on a specific TCP port or a dynamic port &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/sql_protocols/archive/2005/10/19/482840.aspx" mce_href="http://blogs.msdn.com/sql_protocols/archive/2005/10/19/482840.aspx"&gt;Configure and manage SQL Server 2005 from your application using WMI&lt;/A&gt; &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/sql_protocols/archive/2005/10/12/480192.aspx" mce_href="http://blogs.msdn.com/sql_protocols/archive/2005/10/12/480192.aspx"&gt;IPv6 and SQL Server 2005&lt;/A&gt; &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/ms345359.aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms345359.aspx"&gt;Connecting Using IPv6&lt;/A&gt; &lt;/LI&gt;&lt;/UL&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ramu Konidena&lt;/P&gt;
&lt;P&gt;Microsoft SQL Server Support Technical Lead&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9837916" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/sqlblog/archive/tags/SQL+Port/">SQL Port</category></item><item><title>Dealing with very large SQL Compact database files</title><link>http://blogs.msdn.com/b/sqlblog/archive/2009/07/14/dealing-with-very-large-sql-compact-database-files.aspx</link><pubDate>Wed, 15 Jul 2009 02:27:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9833650</guid><dc:creator>sqlblog</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/sqlblog/rsscomments.aspx?WeblogPostID=9833650</wfw:commentRss><comments>http://blogs.msdn.com/b/sqlblog/archive/2009/07/14/dealing-with-very-large-sql-compact-database-files.aspx#comments</comments><description>&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Working with very large SQL Compact files, you may run into two issues:&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;o:p&gt;&lt;FONT size=3 face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.25in; mso-list: l0 level1 lfo1" class=MsoListParagraph&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="COLOR: #1f497d; FONT-SIZE: 13.5pt; mso-bidi-font-family: Calibri; mso-ascii-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-size: 11.0pt"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri&gt;1.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;Manipulating a large SQL Compact database&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt; &lt;B style="mso-bidi-font-weight: normal"&gt;in VS 2008 IDE requires a hotfix&lt;o:p&gt;&lt;/o:p&gt;&lt;/B&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;o:p&gt;&lt;FONT size=3 face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;A href="http://support.microsoft.com/kb/968436" mce_href="http://support.microsoft.com/kb/968436"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;FONT size=3 face=Calibri&gt;http://support.microsoft.com/kb/968436&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;o:p&gt;&lt;FONT size=3 face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Error message when you use the Visual Studio 2008 IDE to manipulate a SQL Server Compact 3.5 Database file which is larger than &lt;B style="mso-bidi-font-weight: normal"&gt;128&lt;/B&gt; Megabytes: "The database file that is larger than the configured maximum database size"&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;o:p&gt;&lt;FONT size=3 face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.25in; mso-list: l0 level1 lfo1" class=MsoListParagraph&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="COLOR: #1f497d; FONT-SIZE: 13.5pt; mso-bidi-font-family: Calibri; mso-ascii-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-size: 11.0pt"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri&gt;2.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;Upgrading &lt;/SPAN&gt;&lt;/B&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2; mso-fareast-font-family: 'Times New Roman'"&gt;a very large database from SQL Compact 3.1 to 3.5 &lt;/SPAN&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;requires another hotfix&lt;/SPAN&gt;&lt;/B&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;A href="http://support.microsoft.com/kb/971027" mce_href="http://support.microsoft.com/kb/971027"&gt;&lt;FONT color=#0000ff size=3 face=Calibri&gt;http://support.microsoft.com/kb/971027&lt;/FONT&gt;&lt;/A&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2; mso-fareast-font-family: 'Times New Roman'"&gt;FIX: Error message when you upgrade a very large database to SQL Server Compact 3.5: "The database file is larger than the configured maximum database size. This setting takes effect on the first concurrent database connection only" &lt;/SPAN&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt; VERTICAL-ALIGN: top; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto" class=MsoNormal&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Hotfix 3.5.5692.12 fixes a problem where large SQL CE database upgrade fails with an error:&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt; VERTICAL-ALIGN: top" class=MsoNormal&gt;&lt;SPAN style="COLOR: black; FONT-SIZE: 10pt; mso-themecolor: text1; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;FONT face=Calibri&gt;The database file is larger than the configured maximum database size. This setting takes effect on the first concurrent database connection only. [ Required Max Database Size (in MB; 0 if unknown) = &amp;lt;size&amp;gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2; mso-bidi-font-family: 'MS Shell Dlg 2'"&gt;Depending upon the file-size and available resources on the machine, the upgrade process for a &lt;/SPAN&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2; mso-fareast-font-family: 'Times New Roman'"&gt;very large database &lt;/SPAN&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2; mso-bidi-font-family: 'MS Shell Dlg 2'"&gt;may consume significant memory.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This is expected behavior.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;You may want to stop &lt;/SPAN&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;other applications to make room for the Upgrade process to complete.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9833650" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/sqlblog/archive/tags/SQL+Tips+and+Tricks+SQL+Compact+Mobile+CE/">SQL Tips and Tricks SQL Compact Mobile CE</category><category domain="http://blogs.msdn.com/b/sqlblog/archive/tags/SQL+CE/">SQL CE</category></item></channel></rss>