<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:thr='http://purl.org/syndication/thread/1.0' version='2.0'><channel><atom:id>tag:blogger.com,1999:blog-1850047779793623762</atom:id><lastBuildDate>Thu, 28 Jul 2011 21:00:22 +0000</lastBuildDate><title>DotNetIdeas</title><description>.NET Framework/Compact Framework and SharePoint Programming Tips and Tricks</description><link>http://dotnetideasblog.blogspot.com/search/label/Database</link><managingEditor>noreply@blogger.com (DotNetIdeas)</managingEditor><generator>Blogger</generator><openSearch:totalResults>2</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1850047779793623762.post-5426430755290938398</guid><pubDate>Thu, 13 Nov 2008 22:49:00 +0000</pubDate><atom:updated>2009-03-18T12:12:42.219-07:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Database</category><title>My First SSIS Project</title><description>&lt;p&gt;I just finished my first SSIS (SQL Server Integration Services) project. It was a simple project, but covered most of the basic stuff in SSIS.&amp;#160; &lt;/p&gt;  &lt;h2&gt;Tasks&lt;/h2&gt;  &lt;p class="MsoNormal"&gt;Here are the tasks I have used in this project.&lt;/p&gt;  &lt;h3&gt;Foreach Loop Container&lt;/h3&gt;  &lt;p class="MsoNormal"&gt;The first thing in this project is looping through a collection of zipped files and processes them. So it started with a Foreach Loop Container. You need to specify the enumerator and its configuration. Because I need to pass the file name to the processes in this container, I mapped the file name to a variable. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;a href="http://lh5.ggpht.com/_ElXg_EOWn5c/SRyvABRoK-I/AAAAAAAAAGM/FceTuXYkRfA/clip_image002%5B11%5D.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="83" alt="clip_image002" src="http://lh3.ggpht.com/_ElXg_EOWn5c/SRyvAaYB55I/AAAAAAAAAGQ/pArDaGhLS0E/clip_image002_thumb%5B3%5D.jpg" width="244" border="0" v:shapes="_x0000_i1025" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;h3&gt;Execute Process Task&lt;/h3&gt;  &lt;p class="MsoNormal"&gt;I have used &amp;#8220;Execute Process Task&amp;#8221; to unzip a file before loading the data from it to the database. It was very straight forward. There are three things need to be specified: The Executable, Arguments and WorkingDirectory. I was using WinZip, so the executable was the WinZip32.exe in its installed directory. Because the file is encrypted using a password. So the arguments looked like this &amp;#8220;-e -o -s&amp;#8217;password&amp;#8217; filename&amp;#8221;. I used expression and variable for the arguments because I don&amp;#8217;t want to hardcode the password. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;a href="http://lh4.ggpht.com/_ElXg_EOWn5c/SRyvA5bc0uI/AAAAAAAAAGU/f7dg511lEyY/clip_image004%5B11%5D.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="66" alt="clip_image004" src="http://lh4.ggpht.com/_ElXg_EOWn5c/SRyvBBpjrJI/AAAAAAAAAGY/Rg75q5Sie4Q/clip_image004_thumb%5B3%5D.jpg" width="244" border="0" v:shapes="_x0000_i1026" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;div&gt;   &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;-e: extract&lt;br /&gt;-o: overwrite existing file&lt;br /&gt;-s: password&lt;br /&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;br /&gt;

&lt;h3&gt;&lt;span style="mso-no-proof: yes"&gt;Script Task&lt;/span&gt;&lt;/h3&gt;

&lt;p&gt;&lt;span style="mso-no-proof: yes"&gt;&lt;/span&gt;I used Script Task to call our existing logic in a .NET DLL to generate the primary key for one of the table I was loading. To be able to reference the .NET DLLs, I have to not only add the DLLs in GAC, but also copy them to C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 (We are using .NET 2.0)&lt;/p&gt;

&lt;p class="MsoNormal"&gt;I also used two variables to pass and get data from the script. The read only one is for setting the configuration file for the .NET DLL. The other read/write variable is for getting the primary key the script has generated.&lt;/p&gt;

&lt;p class="MsoNormal"&gt;Below are the screen shot of the Script Task Editor and the script itself. &lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;a href="http://lh4.ggpht.com/_ElXg_EOWn5c/SRyvBZmyIHI/AAAAAAAAAGc/bhxEm4DV4ig/clip_image006%5B11%5D.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="80" alt="clip_image006" src="http://lh5.ggpht.com/_ElXg_EOWn5c/SRyvBc1LvlI/AAAAAAAAAGg/HextUHZpgRA/clip_image006_thumb%5B3%5D.jpg" width="244" border="0" v:shapes="_x0000_i1027" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div&gt;
  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #008000"&gt;' Microsoft SQL Server Integration Services Script Task&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #008000"&gt;' Write scripts using Microsoft Visual Basic&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #008000"&gt;' The ScriptMain class is the entry point of the Script Task.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;Imports&lt;/span&gt; System&lt;br /&gt;&lt;span style="color: #0000ff"&gt;Imports&lt;/span&gt; System.Data&lt;br /&gt;&lt;span style="color: #0000ff"&gt;Imports&lt;/span&gt; System.Math&lt;br /&gt;&lt;span style="color: #0000ff"&gt;Imports&lt;/span&gt; Microsoft.SqlServer.Dts.Runtime&lt;br /&gt; &lt;br /&gt;&lt;span style="color: #0000ff"&gt;Public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Class&lt;/span&gt; ScriptMain&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;Public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Sub&lt;/span&gt; Main()&lt;br /&gt;&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;Dim&lt;/span&gt; totalDetailRowCount &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Integer&lt;/span&gt;&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;Dim&lt;/span&gt; totalInvoiceCount &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Integer&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;        totalDetailRowCount = Convert.ToInt32(Dts.Variables.Item(&lt;span style="color: #006080"&gt;&amp;quot;TotalDetailRowCount&amp;quot;&lt;/span&gt;).Value)&lt;br /&gt;        totalInvoiceCount = Convert.ToInt32(Dts.Variables.Item(&lt;span style="color: #006080"&gt;&amp;quot;TotalInvoiceCount&amp;quot;&lt;/span&gt;).Value)&lt;br /&gt;&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;If&lt;/span&gt; (totalDetailRowCount &amp;lt;&amp;gt; totalInvoiceCount) &lt;span style="color: #0000ff"&gt;Then&lt;/span&gt;&lt;br /&gt;            Dts.TaskResult = Dts.Results.Failure&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;Else&lt;/span&gt;&lt;br /&gt;            Dts.TaskResult = Dts.Results.Success&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;If&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Sub&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Class&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;br /&gt;

&lt;p style="background: white; margin: 0in 0in 0pt"&gt;This is how you will set a variable:&lt;/p&gt;

&lt;br /&gt;

&lt;div&gt;
  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;Dts.Variables.Item(&lt;span style="color: #006080"&gt;&amp;quot;SomeIdentifier&amp;quot;&lt;/span&gt;).Value = idReturned&lt;/pre&gt;
&lt;/div&gt;

&lt;br /&gt;

&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;This is how you will convert an object to string: &lt;/span&gt;&lt;/p&gt;

&lt;div&gt;
  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;CType&lt;/span&gt;(Lease.Configuration.ConfigurationSettings.AppSettings(&lt;span style="color: #006080"&gt;&amp;quot;SSISBranchId&amp;quot;&lt;/span&gt;), &lt;span style="color: #0000ff"&gt;String&lt;/span&gt;)&lt;/pre&gt;
&lt;/div&gt;

&lt;br /&gt;

&lt;h3&gt;Data Flow Task&lt;/h3&gt;

&lt;br /&gt;

&lt;p class="MsoNormal"&gt;The Data Flow Task is the primary task in this project. It contains a flat file source, several OLE DB destinations. I was using SQL Server destination originally when I test it on my local machine. Then I found out that the SQL Server destination connects to a local SQL Server database only and bulk loads data into SQL Server tables and views. You cannot use the SQL Server destination in packages that access a SQL Server database on a remote server. Instead, the packages should use the OLE DB destination. I also used some data transformations including Derived Column, Data Conversion, Conditional Split and Script Component. All of them are pretty easy to use. The only thing worth mention is the script for the Script Component. The AudStampOut field was specified in the &amp;#8220;Inputs and Outputs&amp;#8221; in Script Component configuration. 
  &lt;br /&gt;&lt;/p&gt;

&lt;div&gt;
  &lt;div&gt;
    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;Public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Overrides&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Sub&lt;/span&gt; Input0_ProcessInputRow(&lt;span style="color: #0000ff"&gt;ByVal&lt;/span&gt; Row &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; Input0Buffer)&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;Dim&lt;/span&gt; auditStamp &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Decimal&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;Dim&lt;/span&gt; configFileUrl &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; &lt;span style="color: #0000ff"&gt;String&lt;/span&gt; = &lt;span style="color: #0000ff"&gt;String&lt;/span&gt;.Empty&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;Dim&lt;/span&gt; idMgr &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; OurNameSpace.Data.IdentityManager&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: #008000"&gt;'Get config file from SSIS Variable and set the path for the configuration manager&lt;/span&gt;&lt;br /&gt;    OurNameSpace.Configuration.ConfigurationSettings.ConfigFileUrl = &lt;span style="color: #0000ff"&gt;CType&lt;/span&gt;(Variables.ConfigFileURL, &lt;span style="color: #0000ff"&gt;String&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;    SetUserBranchIdentity(idMgr)&lt;br /&gt;&lt;br /&gt;    auditStamp = idMgr.GetDecimalID(&lt;span style="color: #0000ff"&gt;String&lt;/span&gt;.Empty, &lt;span style="color: #006080"&gt;&amp;quot;aud&amp;quot;&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;    Row.AudStampOut = auditStamp&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;End&lt;/span&gt; Sub&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h3&gt;&amp;#160;&lt;/h3&gt;

&lt;h3&gt;Execute SQL Task&lt;/h3&gt;

&lt;br /&gt;

&lt;p class="MsoNormal"&gt;After loading the data, I used a couple of Execute SQL Task to retrieve the total row count from database and validate it. The General tab of the Task Editor looked like below. It also had variables setup in Parameter Mapping and Result Set tabs.&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;a href="http://lh6.ggpht.com/_ElXg_EOWn5c/SRyvB9RWRUI/AAAAAAAAAGk/GjtUpoDQwkM/clip_image008%5B11%5D.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="147" alt="clip_image008" src="http://lh4.ggpht.com/_ElXg_EOWn5c/SRyvCbxWIZI/AAAAAAAAAGo/eHiwXwi5xfc/clip_image008_thumb%5B3%5D.jpg" width="244" border="0" v:shapes="_x0000_i1028" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;File System Task&lt;/h3&gt;

&lt;br /&gt;

&lt;p class="MsoNormal"&gt;When we are done with the file, I want to move them to an archive folder. First I tried to use &amp;#8220;Move file&amp;#8221; operation. But I couldn&amp;#8217;t get it to work if I use variable for the source. Even I set DelayValidation to true, it would still complain &amp;#8220;couldn&amp;#8217;t find the source file&amp;#8221; or something like that. I might be doing something wrong there. But after spending a couple of hours on it, I gave up. Finally I used &amp;#8220;Rename file&amp;#8221; operation which actually did the moving. I set the destination variable to my archive folder plus file name. That did the trick.&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;a href="http://lh4.ggpht.com/_ElXg_EOWn5c/SRyvCiZRWbI/AAAAAAAAAGs/PYzUlNEL-Vc/clip_image010%5B11%5D.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="131" alt="clip_image010" src="http://lh4.ggpht.com/_ElXg_EOWn5c/SRyvDD1XQKI/AAAAAAAAAGw/CivF-oOgd2w/clip_image010_thumb%5B3%5D.jpg" width="244" border="0" v:shapes="_x0000_i1029" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;Send Mail Task&lt;/h3&gt;

&lt;br /&gt;

&lt;p class="MsoNormal"&gt;There is really nothing special about Send Mail Task. You just create a SMTP Connection Manager, specify your mail server. In the task, you specify mail from, mail to and other properties. And you are done.&lt;/p&gt;

&lt;br /&gt;

&lt;h2&gt;Error Handling&lt;/h2&gt;

&lt;br /&gt;

&lt;h3&gt;OnError event&lt;/h3&gt;

&lt;br /&gt;

&lt;p class="MsoNormal"&gt;There are several ways to handle errors in SSIS. In this project, the data flow task was the most important one. So I added an event handler for it. Also because we don&amp;#8217;t want to send out tons of emails, so I added a For Loop to make sure we only send out one error email for each run.&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;a href="http://lh4.ggpht.com/_ElXg_EOWn5c/SRyvDftK7dI/AAAAAAAAAG0/DE5zcyTqpcM/clip_image012%5B11%5D.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="122" alt="clip_image012" src="http://lh5.ggpht.com/_ElXg_EOWn5c/SRyvEGg4y1I/AAAAAAAAAG4/AvtWQMALQ8U/clip_image012_thumb%5B3%5D.jpg" width="244" border="0" v:shapes="_x0000_i1030" /&gt;&lt;/a&gt; 

  &lt;br /&gt;&lt;a href="http://lh6.ggpht.com/_ElXg_EOWn5c/SRyvESro2nI/AAAAAAAAAG8/KY6R3NJ3bCI/clip_image014%5B11%5D.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="95" alt="clip_image014" src="http://lh5.ggpht.com/_ElXg_EOWn5c/SRyvErXehBI/AAAAAAAAAHA/aK7N0o4UJcg/clip_image014_thumb%5B3%5D.jpg" width="244" border="0" v:shapes="_x0000_i1031" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;Transaction&lt;/h3&gt;

&lt;br /&gt;

&lt;p class="MsoNormal"&gt;I wanted the data flow task run in a transaction, so when one of the components fails, it would roll back everything. The default setting for the task is &amp;#8220;Supported&amp;#8221; which means the task will enlist in an existing transaction. Since we don&amp;#8217;t have an existing transaction, I need to change it to &amp;#8220;Required&amp;#8221; which will create a transaction if none exists and enlist in an existing one.&lt;/p&gt;

&lt;br /&gt;

&lt;h2&gt;Deployment&lt;/h2&gt;

&lt;br /&gt;

&lt;h3&gt;Configuration File&lt;/h3&gt;

&lt;br /&gt;

&lt;p class="MsoNormal"&gt;Before deploy a SSIS package, you will generally need to create a configuration file. You can then store your database connection, file location, email server connection and etc. This information should be configurable.&lt;/p&gt;

&lt;p class="MsoNormal"&gt;Here are the steps to create a configuration file:&lt;/p&gt;

&lt;ol style="margin-top: 0in" type="1"&gt;
  &lt;br /&gt;

  &lt;li class="MsoNormal" style="mso-list: l0 level1 lfo1; tab-stops: list .5in"&gt;Right click on any blank space in the control flow tab 
    &lt;br /&gt;&lt;/li&gt;

  &lt;li class="MsoNormal" style="mso-list: l0 level1 lfo1; tab-stops: list .5in"&gt;Choose &amp;#8220;Package Configurations&amp;#8230;&amp;#8221; from the pop-up menu. 
    &lt;br /&gt;&lt;/li&gt;

  &lt;li class="MsoNormal" style="mso-list: l0 level1 lfo1; tab-stops: list .5in"&gt;Check the &amp;#8220;Enable package configuration&amp;#8221; checkbox 
    &lt;br /&gt;&lt;/li&gt;

  &lt;li class="MsoNormal" style="mso-list: l0 level1 lfo1; tab-stops: list .5in"&gt;Click on &amp;#8220;Add..&amp;#8221; button and the configuration wizard will show up. 
    &lt;br /&gt;&lt;/li&gt;

  &lt;li class="MsoNormal" style="mso-list: l0 level1 lfo1; tab-stops: list .5in"&gt;Follow the steps in the wizard to choose configuration type, file name and variable or properties you want to put in the configuration. &lt;/li&gt;
&lt;/ol&gt;

&lt;br /&gt;

&lt;p class="MsoNormal"&gt;Note: after I had it set up, I occasionally run into an issue with opening the configuration editor. It would give me a message saying could not load the configuration file or something. If I just close the package and re-open it, everything will be fine. It is kind of strange.&lt;/p&gt;

&lt;p class="MsoNormal"&gt;The ProtectionLevel property under &amp;#8220;Security&amp;#8221; is default to &amp;#8220;EncryptSensitiveWithUserKey&amp;#8221;. Since we want to have the control of which user will be using to run this package, we have to choose &amp;#8220;DontSaveSensitive&amp;#8221;. Then when we deploy the package, we will manually enter the sensitive data, such as password for database access.&lt;/p&gt;

&lt;p class="MsoNormal"&gt;To build the deployment package, you need to open the properties window by right clicking the project and choose the &amp;quot;Properties&amp;quot; from the popup menu&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;a href="http://lh4.ggpht.com/_ElXg_EOWn5c/ScFHpWIhanI/AAAAAAAAATg/hC8Tf4MDzbg/image%5B2%5D.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="161" alt="image" src="http://lh3.ggpht.com/_ElXg_EOWn5c/ScFHqCUdGbI/AAAAAAAAATk/nw6Mm4wpdSQ/image_thumb.png" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p class="MsoNormal"&gt;Click on &amp;quot;Deployment Utility&amp;quot; and change the &amp;quot;CreateDeploymentUtility&amp;quot; to &amp;quot;True&amp;quot;. Set the DeploymentOutputPath if you want.&lt;/p&gt;

&lt;p class="MsoNormal"&gt;The build process will generate the package file *.dtsx, the configuration file *.dtsConfig(if you choose to use xml configuration file) and the deployment manifest file *.SSISDeploymentManifest under \bin\Deployment\ folder. You can double click on the manifest file and a package installation wizard will help you to deploy the SSIS package. You will have a chance to change the configuration in the wizard.&lt;/p&gt;

&lt;p class="MsoNormal"&gt;Now my first SSIS package is ready to run. To trigger it, I used the following command.&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&amp;quot;C:\Program Files (x86)\Microsoft SQL Server\90\DTS\Binn\dtexec&amp;quot; /file &amp;quot;SSISyoupackage.dtsx&amp;quot;&lt;/p&gt;

&lt;br /&gt;

&lt;br /&gt;

&lt;p class="MsoNormal"&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1850047779793623762-5426430755290938398?l=dotnetideasblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://dotnetideasblog.blogspot.com/2008/11/my-first-ssis-project.html</link><author>noreply@blogger.com (DotNetIdeas)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_ElXg_EOWn5c/SRyvAaYB55I/AAAAAAAAAGQ/pArDaGhLS0E/s72-c/clip_image002_thumb%5B3%5D.jpg' height='72' width='72'/><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1850047779793623762.post-3551601804742657083</guid><pubDate>Tue, 01 Jan 2008 22:19:00 +0000</pubDate><atom:updated>2009-03-18T08:45:08.485-07:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Database</category><title>Miscellaneous Database Tips</title><description>&lt;p&gt;&lt;span style="mso-fareast-language: zh-cn"&gt;Over the years, I have used Informix, Sybase, DB2 and SQL Server databases. These are some notes from the past.&lt;/span&gt;&lt;/p&gt;  &lt;h2&gt;&lt;span style="mso-fareast-language: zh-cn"&gt;Informix&lt;/span&gt;&lt;/h2&gt;  &lt;ul&gt;   &lt;li&gt;     &lt;p&gt;&lt;span style="mso-fareast-language: zh-cn"&gt;&lt;/span&gt;&lt;/p&gt;      &lt;p&gt;&lt;/p&gt;      &lt;p&gt;&lt;/p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="mso-fareast-language: zh-cn"&gt;How to have substring in a SQL&lt;/span&gt;       &lt;p&gt;&lt;/p&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;div&gt;   &lt;div&gt;     &lt;div&gt;       &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;select&lt;/span&gt; columnName 
&lt;span style="color: #0000ff"&gt;from&lt;/span&gt; table1 
&lt;span style="color: #0000ff"&gt;where&lt;/span&gt; columnName[1,3] = &amp;#8220;abc&amp;#8221;;&lt;/pre&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;ul style="margin-top: 0in" type="disc"&gt;
  &lt;li class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-list: l0 level1 lfo1"&gt;
    &lt;p&gt;&lt;span style="font-size: 10pt; font-family: &amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;; mso-fareast-language: zh-cn; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;"&gt;To concacentae two string columns in the SQL(Informix), use &amp;quot;||&amp;quot; instead of &amp;quot;+&amp;quot;&lt;/span&gt;&lt;/p&gt;
  &lt;/li&gt;

  &lt;li class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-list: l0 level1 lfo1"&gt;&lt;span style="font-size: 10pt; font-family: &amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;; mso-fareast-language: zh-cn; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;"&gt;&lt;/span&gt;&lt;span style="mso-fareast-language: zh-cn"&gt;To get the record which in one table, but not in another table, use &amp;quot;not exists&amp;quot;, not &amp;quot;not in&amp;quot; &lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div&gt;
  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;select * from table_A &lt;span style="color: #0000ff"&gt;where&lt;/span&gt; not exists (select id_b from table_B &lt;span style="color: #0000ff"&gt;where&lt;/span&gt; table_B.id_b = table_A.id_A)&lt;/pre&gt;
&lt;/div&gt;

&lt;ul&gt;
  &lt;li class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-list: l0 level1 lfo1"&gt;&lt;span style="font-size: 10pt; font-family: &amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;; mso-fareast-language: zh-cn; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;"&gt;&lt;/span&gt;&lt;span style="mso-fareast-language: zh-cn"&gt;When write the SQL for a Union, for example: &lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;ul style="margin-top: 0in" type="disc"&gt;
  &lt;div&gt;
    &lt;div&gt;
      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;select&lt;/span&gt; AA, &amp;quot; &amp;quot; &lt;span style="color: #0000ff"&gt;from&lt;/span&gt; table_a 
&lt;span style="color: #0000ff"&gt;union&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;select&lt;/span&gt; BB, BC &lt;span style="color: #0000ff"&gt;from&lt;/span&gt; table_b 
&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; BC's &lt;span style="color: #0000ff"&gt;size&lt;/span&gt; &lt;span style="color: #0000ff"&gt;is&lt;/span&gt; greater &lt;span style="color: #0000ff"&gt;than&lt;/span&gt; the length &lt;span style="color: #0000ff"&gt;of&lt;/span&gt; &amp;quot; &amp;quot;, you will &lt;span style="color: #0000ff"&gt;get&lt;/span&gt; a &amp;quot;&lt;span style="color: #0000ff"&gt;Select&lt;/span&gt; error&amp;quot;&lt;/pre&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/ul&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;; mso-fareast-language: zh-cn; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;"&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;ul style="margin-top: 0in" type="disc"&gt;
  &lt;li class="MsoNormal" style="mso-list: l2 level1 lfo2"&gt;&lt;span style="mso-fareast-language: zh-cn"&gt;To set datetime &lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div&gt;
  &lt;div&gt;
    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;update&lt;/span&gt; table1 &lt;span style="color: #0000ff"&gt;set&lt;/span&gt; columnName = datetime(2003-09-03 00:00:01) &lt;span style="color: #0000ff"&gt;year&lt;/span&gt; &lt;span style="color: #0000ff"&gt;to&lt;/span&gt; &lt;span style="color: #0000ff"&gt;second&lt;/span&gt;; &lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;span style="mso-fareast-language: zh-cn"&gt;Generate Dynamic SQL &lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div&gt;
  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;select&lt;/span&gt; &lt;span style="color: #006080"&gt;'update msg set msg_ttl = '&lt;/span&gt;&lt;span style="color: #006080"&gt;'ABC Inventory'&lt;/span&gt;&lt;span style="color: #006080"&gt;' where msg_cd = '&lt;/span&gt;||msg_cd||&lt;span style="color: #006080"&gt;';'&lt;/span&gt; &lt;span style="color: #0000ff"&gt;from&lt;/span&gt; msg 
&lt;span style="color: #0000ff"&gt;where&lt;/span&gt; msg_ttl = &lt;span style="color: #006080"&gt;'DEF Inventory'&lt;/span&gt;; &lt;/pre&gt;
&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;span style="mso-fareast-language: zh-cn"&gt;&lt;/span&gt;&lt;span style="mso-fareast-language: zh-cn"&gt;Lock table &lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div&gt;
  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;begin&lt;/span&gt; &lt;span style="color: #0000ff"&gt;work&lt;/span&gt;; 
lock &lt;span style="color: #0000ff"&gt;table&lt;/span&gt; tableName &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; exclusive mode;&lt;/pre&gt;
&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Group by and having &lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
  &lt;div&gt;
    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;Select&lt;/span&gt; column1 &lt;span style="color: #0000ff"&gt;from&lt;/span&gt; table1 &lt;span style="color: #0000ff"&gt;group&lt;/span&gt; &lt;span style="color: #0000ff"&gt;by&lt;/span&gt; column1 &lt;span style="color: #0000ff"&gt;having&lt;/span&gt; &lt;span style="color: #0000ff"&gt;count&lt;/span&gt;(column1)&amp;gt;0; &lt;/pre&gt;
  &lt;/div&gt;

  &lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;&lt;span style="mso-fareast-language: zh-cn"&gt;DB2&lt;/span&gt;&lt;/h2&gt;

&lt;h2&gt;&lt;span style="mso-fareast-language: zh-cn"&gt;
    &lt;p&gt;&lt;/p&gt;
  &lt;/span&gt;&amp;#160;&lt;/h2&gt;

&lt;h3&gt;&lt;span style="mso-fareast-language: zh-cn"&gt;When getting SQL0952N Processing was cancelled due to an interrupt. SQLSTATE=57014 
    &lt;p&gt;&lt;/p&gt;
  &lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;; mso-fareast-language: zh-cn; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;"&gt;&lt;/span&gt;&lt;/h3&gt;

&lt;p&gt;&lt;span style="mso-fareast-language: zh-cn"&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;; mso-fareast-language: zh-cn; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;"&gt;Go to \Program Files\IBM\SQLLIB\db2cli.ini &lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;; mso-fareast-language: zh-cn; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;"&gt;
    &lt;br /&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span style="font-size: 10pt; font-family: &amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;; mso-fareast-language: zh-cn; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;"&gt;Add the following session: &lt;/span&gt;&lt;/p&gt;
&lt;span style="font-size: 10pt; font-family: &amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;; mso-fareast-language: zh-cn; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;"&gt;
  &lt;p&gt;[Common] &lt;/p&gt;

  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: &amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;; mso-fareast-language: zh-cn; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;"&gt;QUERYTIMEOUTINTERVAL=500 &lt;/span&gt;&lt;/p&gt;
&lt;/span&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;; mso-fareast-language: zh-cn; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;"&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;h2&gt;&lt;span style="mso-fareast-language: zh-cn"&gt;Oracle 
    &lt;p&gt;&lt;/p&gt;
  &lt;/span&gt;&lt;/h2&gt;

&lt;h3&gt;&lt;span style="mso-fareast-language: zh-cn"&gt;&lt;/span&gt;&amp;#160;&lt;/h3&gt;

&lt;h3&gt;&lt;span style="mso-fareast-language: zh-cn"&gt;Get current date 
    &lt;p&gt;&lt;/p&gt;
  &lt;/span&gt;&lt;/h3&gt;

&lt;table class="MsoNormalTable" style="margin-left: 4.65pt; width: 469.5pt; border-collapse: collapse; mso-yfti-tbllook: 1184; mso-padding-alt: 0in 5.4pt 0in 5.4pt" cellspacing="0" cellpadding="0" width="626" border="0"&gt;&lt;tbody&gt;
    &lt;tr style="height: 12.75pt; mso-yfti-irow: 0; mso-yfti-firstrow: yes; mso-row-margin-right: 123.5pt"&gt;
      &lt;td style="padding-right: 5.4pt; padding-left: 5.4pt; padding-bottom: 0in; width: 346pt; padding-top: 0in; height: 12.75pt" valign="bottom" width="461"&gt;
        &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;; mso-fareast-language: zh-cn; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;"&gt;select sysdate from dual; &lt;/span&gt;&lt;/p&gt;

        &lt;p&gt;&lt;/p&gt;

        &lt;p&gt;&lt;/p&gt;

        &lt;p&gt;&lt;/p&gt;
      &lt;/td&gt;

      &lt;td style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; padding-bottom: 0in; border-left: medium none; padding-top: 0in; border-bottom: medium none; mso-cell-special: placeholder" width="165"&gt;
        &lt;p class="MsoNormal"&gt;&amp;#160;&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr style="height: 12.75pt; mso-yfti-irow: 1; mso-row-margin-right: 123.5pt"&gt;
      &lt;td style="padding-right: 5.4pt; padding-left: 5.4pt; padding-bottom: 0in; width: 346pt; padding-top: 0in; height: 12.75pt" valign="bottom" width="461"&gt;
        &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;; mso-fareast-language: zh-cn; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;"&gt;select * from table_a where some_date &amp;gt;= sysdate - 1(yesterday) &lt;/span&gt;&lt;/p&gt;

        &lt;p&gt;&lt;/p&gt;

        &lt;p&gt;&lt;/p&gt;

        &lt;p&gt;&lt;/p&gt;
      &lt;/td&gt;

      &lt;td style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; padding-bottom: 0in; border-left: medium none; padding-top: 0in; border-bottom: medium none; mso-cell-special: placeholder" width="165"&gt;
        &lt;p class="MsoNormal"&gt;&amp;#160;&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr style="height: 25.5pt; mso-yfti-irow: 2; mso-row-margin-right: 123.5pt"&gt;
      &lt;td style="padding-right: 5.4pt; padding-left: 5.4pt; padding-bottom: 0in; width: 346pt; padding-top: 0in; height: 25.5pt" valign="bottom" width="461"&gt;
        &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;; mso-fareast-language: zh-cn; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;"&gt;To_date(to_char(sysdate -1, 'YY/mm/DD'), 'YY/mm/DD') -&amp;gt; yesterday, 00:00:00 &lt;/span&gt;&lt;/p&gt;

        &lt;p&gt;&lt;/p&gt;

        &lt;p&gt;&lt;/p&gt;

        &lt;p&gt;&lt;/p&gt;
      &lt;/td&gt;

      &lt;td style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; padding-bottom: 0in; border-left: medium none; padding-top: 0in; border-bottom: medium none; mso-cell-special: placeholder" width="165"&gt;
        &lt;p class="MsoNormal"&gt;&amp;#160;&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr style="height: 12.75pt; mso-yfti-irow: 3; mso-yfti-lastrow: yes"&gt;
      &lt;td style="padding-right: 5.4pt; padding-left: 5.4pt; padding-bottom: 0in; width: 469.5pt; padding-top: 0in; height: 12.75pt" valign="bottom" nowrap="nowrap" width="626" colspan="2"&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;&lt;/table&gt;

&lt;h2&gt;&lt;span style="mso-fareast-language: zh-cn"&gt;&lt;/span&gt;&amp;#160;&lt;/h2&gt;

&lt;h2&gt;&lt;span style="mso-fareast-language: zh-cn"&gt;SQL Server 
    &lt;p&gt;&lt;/p&gt;
  &lt;/span&gt;&lt;/h2&gt;

&lt;h3&gt;&lt;span style="mso-fareast-language: zh-cn"&gt;&lt;/span&gt;&amp;#160;&lt;/h3&gt;

&lt;h3&gt;&lt;span style="mso-fareast-language: zh-cn"&gt;Installation issue 
    &lt;p&gt;&lt;/p&gt;
  &lt;/span&gt;&lt;/h3&gt;

&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 9pt; line-height: 115%; font-family: &amp;#39;Segoe UI&amp;#39;,&amp;#39;sans-serif&amp;#39;"&gt;I am learning SSIS on my new vista VM machine. I wanted to config the SQL Server database. But the database wouldn&amp;#8217;t start. I am getting the following error: &lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 9pt; line-height: 115%; font-family: &amp;#39;Segoe UI&amp;#39;,&amp;#39;sans-serif&amp;#39;"&gt;&amp;#8220;SQL Server could not spawn FRunCM thread. Check the SQL Server error log and the Windows event logs for information about possible related problems.&amp;#8221; &lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 9pt; line-height: 115%; font-family: &amp;#39;Segoe UI&amp;#39;,&amp;#39;sans-serif&amp;#39;"&gt;After googling it, I found an article: &lt;/span&gt;&lt;a href="http://blogs.msdn.com/sql_protocols/archive/2005/10/31/487090.aspx"&gt;&lt;span style="font-size: 9pt; line-height: 115%; font-family: &amp;#39;Segoe UI&amp;#39;,&amp;#39;sans-serif&amp;#39;"&gt;http://blogs.msdn.com/sql_protocols/archive/2005/10/31/487090.aspx&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 9pt; line-height: 115%; font-family: &amp;#39;Segoe UI&amp;#39;,&amp;#39;sans-serif&amp;#39;"&gt; &lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 9pt; line-height: 115%; font-family: &amp;#39;Segoe UI&amp;#39;,&amp;#39;sans-serif&amp;#39;"&gt;It was talking about disabling &amp;#8220;VIA protocol&amp;#8221;. I went to SQL Server Configuration Manager and found VIA protocol, but it was disabled already. Then I read along the comments on that blog and found this: &lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&amp;#8220;Looks like you disabled all protocols. Without a protocol enabled, sql server won't be able accept requests and process queries. You need to enable at least one protocol.&amp;#8221;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;Aha! That was my issue. I enabled TCP/IP protocol. Everything looks fine now.&lt;/p&gt;

&lt;h3&gt;Outer join&lt;/h3&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"&gt;SELECT column_name(s)&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"&gt;FROM table_name1&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"&gt;LEFT OUTER JOIN table_name2 &lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"&gt;ON table_name1.column_name=table_name2.column_name&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;; mso-fareast-language: zh-cn; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1850047779793623762-3551601804742657083?l=dotnetideasblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://dotnetideasblog.blogspot.com/2008/01/miscellaneous-database-tips.html</link><author>noreply@blogger.com (DotNetIdeas)</author><thr:total>0</thr:total></item></channel></rss>