<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://sqlblogcasts.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">Dong Xie&amp;#39;s Blog</title><subtitle type="html">Dong Xie currently works as a RA/Programmer in the Oxford University, programming systems for Human Genetics research, with MS products, especially SQL Server.</subtitle><id>http://sqlblogcasts.com/blogs/dong/atom.aspx</id><link rel="alternate" type="text/html" href="http://sqlblogcasts.com/blogs/dong/default.aspx" /><link rel="self" type="application/atom+xml" href="http://sqlblogcasts.com/blogs/dong/atom.aspx" /><generator uri="http://communityserver.org" version="3.1.20917.1142">Community Server</generator><updated>2006-07-13T15:17:00Z</updated><entry><title>EXAM VOUCHER, one left.</title><link rel="alternate" type="text/html" href="http://sqlblogcasts.com/blogs/dong/archive/2006/12/22/exam-voucher-one-left.aspx" /><id>http://sqlblogcasts.com/blogs/dong/archive/2006/12/22/exam-voucher-one-left.aspx</id><published>2006-12-22T16:47:00Z</published><updated>2006-12-22T16:47:00Z</updated><content type="html">&lt;p&gt;I still have one free exam voucher left from the Launch Tour 2005. You can use it to take one of the following exam:&lt;/p&gt;&lt;p&gt;70-431, 70-536, 70-551, 70-552, 70-553, 70-235&lt;/p&gt;&lt;p&gt;The voucher expires on 31-12-2006, that means you must take it before the new year. I'm sure the Prometric centre at Ealing, London will be open to book. Most of other testing centres will be either fully booked or closed.&lt;/p&gt;&lt;p&gt;Email me or leave comments, then I'll send you the code.&lt;/p&gt;&lt;p&gt;Merry Christmas and Happy New Year!&lt;br&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=1510" width="1" height="1"&gt;</content><author><name>dong</name><uri>http://sqlblogcasts.com/members/dong.aspx</uri></author></entry><entry><title>2.3 GByte/s, can your SAN do that?</title><link rel="alternate" type="text/html" href="http://sqlblogcasts.com/blogs/dong/archive/2006/12/07/2-3-gbyte-s-can-your-san-do-that.aspx" /><id>http://sqlblogcasts.com/blogs/dong/archive/2006/12/07/2-3-gbyte-s-can-your-san-do-that.aspx</id><published>2006-12-07T12:06:00Z</published><updated>2006-12-07T12:06:00Z</updated><content type="html">&lt;p&gt;Recently I built a new server to run our beloved SQL Server 2005. The design idea came from &lt;a href="http://research.microsoft.com/%7Egray/" target="_blank"&gt;Dr. Jim Gray&lt;/a&gt;'s server brick and SQL Server Magazine March 2006 article "&lt;a href="http://www.sqlmag.com/Article/ArticleID/49011/Pare_Down_and_Power_Up.html" target="_blank"&gt;Pare Down and Power Up&lt;/a&gt;". Major difference with them are: I choose to use SAS JBOD and SAS RAID controller, and SAS drive. So that the RAID-1, RAID-0, RAID-10 jobs are offloaded from server CPU.&lt;/p&gt; &lt;p&gt;Here comes the proof screenshot during my configuration testing with IO Meter:&lt;/p&gt; &lt;p&gt;&lt;a href="http://sqlblogcasts.com/blogs/dong/WindowsLiveWriter/2.3GBytescanyourSANdothat_FAED/image%7B0%7D%5B4%5D.gif"&gt;&lt;img src="http://sqlblogcasts.com/blogs/dong/WindowsLiveWriter/2.3GBytescanyourSANdothat_FAED/image%7B0%7D_thumb%5B2%5D.gif" alt="IOMeterScreenshot" height="453" width="773"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&lt;i&gt;Figure 1, IO Meter screenshot, 2.37GB/s Reading speed, at a CPU load 4.75%&lt;/i&gt;&lt;/p&gt; &lt;p&gt;This is by far the maximum sustainable number I can achieve, although I believe the system could do better, at least in theory. You may argue that I won't get this fast in production, and yes, I agree, only half the spindle will goes for a Very Large Table File Group, others goes for LOG, TempDB, etc. But still, doing a table scan at 1GB/s for a 1TB sized table only need 15 mins.&lt;/p&gt; &lt;p&gt;Here is the challenge for the lucky SAN owners: please use the comment area&amp;nbsp;to show people that your expensive SAN can do better than this. Information needed:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;i&gt;Your SAN vendor,&lt;/i&gt;&lt;/li&gt; &lt;li&gt;&lt;i&gt;Model,&lt;/i&gt;&lt;/li&gt; &lt;li&gt;&lt;i&gt;Peak speed,&lt;/i&gt;&lt;/li&gt; &lt;li&gt;&lt;i&gt;Price tag&lt;/i&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;If anyone can kindly offer some prize, then we can run this as a competition! (Note: I hope Santa is browsing our Blog.)&lt;/p&gt;&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=1476" width="1" height="1"&gt;</content><author><name>dong</name><uri>http://sqlblogcasts.com/members/dong.aspx</uri></author><category term="Hardware" scheme="http://sqlblogcasts.com/blogs/dong/archive/tags/Hardware/default.aspx" /><category term="SQL IO" scheme="http://sqlblogcasts.com/blogs/dong/archive/tags/SQL+IO/default.aspx" /></entry><entry><title>How To: BULK INSERT your User Defined Types (UDT)?</title><link rel="alternate" type="text/html" href="http://sqlblogcasts.com/blogs/dong/archive/2006/11/27/how-to-bulk-insert-your-user-defined-types-udt.aspx" /><id>http://sqlblogcasts.com/blogs/dong/archive/2006/11/27/how-to-bulk-insert-your-user-defined-types-udt.aspx</id><published>2006-11-27T16:42:00Z</published><updated>2006-11-27T16:42:00Z</updated><content type="html">
&lt;p&gt;The task is to bulk load data from flat files into tables with UDT column. This blog post will show you the problem and the solution.&lt;/p&gt;
 
&lt;p&gt;We will use the &lt;b&gt;Point&lt;/b&gt; type as an example, which you can find the source code from the Books On Line (BOL), or from &lt;a href="http://msdn2.microsoft.com/en-us/library/ms131106.aspx" target="_blank"&gt;MSDN web&lt;/a&gt;, or from &lt;a href="http://sqlblogcasts.com/files/folders/dongsfiles/default.aspx"&gt;my blog file folder&lt;/a&gt;.&lt;/p&gt;
 
&lt;p&gt;Suppose you've either compiled your source code into a DLL by using Visual Studio, or you downloaded it, the next step is to open SSMS, open a Query window, use TempDB or create a TEST database, then run these SQL statements:&lt;/p&gt;  
&lt;div class="cf"&gt; 
&lt;p class="cl"&gt;&lt;span class="cb1"&gt;CREATE ASSEMBLY&lt;/span&gt; Point&lt;/p&gt;
 
&lt;p class="cl"&gt;&lt;span class="cb1"&gt;FROM &lt;/span&gt;&lt;span class="cb2"&gt;'D:\DongDoc\SQL Server Management Studio\Projects\UDT_Point\UDT_Point.dll'&lt;/span&gt;&lt;/p&gt;
 
&lt;p class="cl"&gt;GO;&lt;/p&gt;
 
&lt;p class="cl"&gt;&amp;nbsp;&lt;/p&gt;
 
&lt;p class="cl"&gt;&lt;span class="cb1"&gt;CREATE TYPE &lt;/span&gt;Point&lt;/p&gt;
 
&lt;p class="cl"&gt;&lt;span class="cb1"&gt;EXTERNAL NAME &lt;/span&gt;Point.[Point];&lt;/p&gt;
 
&lt;p class="cl"&gt;GO;&lt;/p&gt;
 
&lt;p class="cl"&gt;&amp;nbsp;&lt;/p&gt;
 
&lt;p class="cl"&gt;&lt;span class="cb1"&gt;CREATE TABLE &lt;/span&gt;T1&lt;/p&gt;
 
&lt;p class="cl"&gt;(&lt;/p&gt;
 
&lt;p class="cl"&gt;Col1 &lt;span class="cb1"&gt;VARCHAR&lt;/span&gt;(10) &lt;span class="cb1"&gt;NULL&lt;/span&gt;,&lt;/p&gt;
 
&lt;p class="cl"&gt;Col2 Point &lt;span class="cb1"&gt;NULL&lt;/span&gt;&lt;/p&gt;
 
&lt;p class="cl"&gt;)&lt;/p&gt;
 
&lt;p class="cl"&gt;GO;&lt;/p&gt;
 
&lt;p class="cl"&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt; 
&lt;p class="cl"&gt;Now we stuff our Table T1 with some value:&lt;/p&gt;
 
&lt;p class="cl"&gt;&amp;nbsp;&lt;/p&gt;
 &lt;div class="cf"&gt; 
&lt;p class="cl"&gt;&lt;span class="cb1"&gt;INSERT INTO &lt;/span&gt;dbo.T1 (Col1, Col2) &lt;span class="cb1"&gt;VALUES &lt;/span&gt;(&lt;span class="cb2"&gt;'TEST'&lt;/span&gt;, &lt;span class="cb1"&gt;CONVERT&lt;/span&gt;(Point, &lt;span class="cb2"&gt;'3,4'&lt;/span&gt;));&lt;/p&gt;
 
&lt;p class="cl"&gt;&lt;span class="cb1"&gt;INSERT INTO &lt;/span&gt;dbo.T1 (Col1, Col2) &lt;span class="cb1"&gt;VALUES &lt;/span&gt;(&lt;span class="cb2"&gt;'TEST'&lt;/span&gt;, &lt;span class="cb1"&gt;CONVERT&lt;/span&gt;(Point, &lt;span class="cb2"&gt;'1,5'&lt;/span&gt;));&lt;/p&gt;
 
&lt;p class="cl"&gt;&lt;span class="cb1"&gt;INSERT INTO &lt;/span&gt;dbo.T1 (Col1, Col2) &lt;span class="cb1"&gt;VALUES &lt;/span&gt;(&lt;span class="cb2"&gt;'TEST'&lt;/span&gt;, &lt;span class="cb1"&gt;CAST &lt;/span&gt;(&lt;span class="cb2"&gt;'1,99' &lt;/span&gt;&lt;span class="cb1"&gt;AS &lt;/span&gt;Point));&lt;/p&gt;
&lt;/div&gt; 
&lt;p&gt;By doing CAST/CONVERT from string to UDT type, CLR Engine will call Point class' Parse(SqlString s) method. If now we do a SELECT *, the result is like:&lt;/p&gt;
 
&lt;p&gt;Col1 Col2&lt;br&gt;---------- --------------------&lt;br&gt;TEST 0x008000000380000004&lt;br&gt;TEST 0x008000000180000005&lt;br&gt;TEST 0x008000000180000063  &lt;/p&gt;
&lt;p&gt;At this point, if you are a programmer, you should realized that UDT in the database is to persist object instances into Binary/Byte format. So these insert will success as well:&lt;/p&gt;
 &lt;div class="cf"&gt; 
&lt;p class="cl"&gt;&lt;span class="cb3"&gt;--INSERT Binary Representation of the UDT with type cast&lt;/span&gt;&lt;/p&gt;
 
&lt;p class="cl"&gt;&lt;span class="cb1"&gt;INSERT INTO &lt;/span&gt;dbo.T1 (Col1, Col2) &lt;span class="cb1"&gt;VALUES&lt;/span&gt;(&lt;span class="cb2"&gt;'TESTBS'&lt;/span&gt;, &lt;/p&gt;
 
&lt;p class="cl"&gt;&lt;span class="cb1"&gt;CAST&lt;/span&gt;(0x008000000380000004 &lt;span class="cb1"&gt;AS &lt;/span&gt;Point));&lt;/p&gt;
 
&lt;p class="cl"&gt;&amp;nbsp;&lt;/p&gt;
 
&lt;p class="cl"&gt;&lt;span class="cb3"&gt;--INSERT Binary Representation of the UDT without cast&lt;/span&gt;&lt;/p&gt;
 
&lt;p class="cl"&gt;&lt;span class="cb1"&gt;INSERT INTO &lt;/span&gt;dbo.T1 (Col1, Col2) &lt;span class="cb1"&gt;VALUES&lt;/span&gt;(&lt;span class="cb2"&gt;'TESTBS'&lt;/span&gt;,&lt;/p&gt;
 
&lt;p class="cl"&gt;0x008000000380000004);&lt;/p&gt;
&lt;/div&gt; 
&lt;p&gt;&amp;nbsp;Now we prepare a text file to try BULK INSERT:&lt;/p&gt;
 
&lt;p&gt;Data1.txt (save as Tab Delimited)&lt;/p&gt;
 
&lt;p&gt;------------&lt;/p&gt;
 
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
TEST 0x008000000380000004&lt;br&gt;TEST 0x008000000180000005&lt;br&gt;TEST 0x008000000180000063  
&lt;p&gt;The BULK INSERT statement:&lt;/p&gt;
 &lt;div class="cf"&gt; 
&lt;p class="cl"&gt;&lt;span class="cb3"&gt;--BULK INSERT&lt;/span&gt;&lt;/p&gt;
 
&lt;p class="cl"&gt;&lt;span class="cb1"&gt;BULK INSERT &lt;/span&gt;dbo.T1 &lt;span class="cb1"&gt;FROM&lt;/span&gt;&lt;/p&gt;
 
&lt;p class="cl"&gt;&lt;span class="cb2"&gt;'D:\DongDoc\SQL Server Management Studio\Projects\UDT_Point\Data1.txt'&lt;/span&gt;&lt;/p&gt;
 
&lt;p class="cl"&gt;&lt;span class="cb1"&gt;WITH&lt;/span&gt;(&lt;/p&gt;
 
&lt;p class="cl"&gt;DATAFILETYPE = &lt;span class="cb2"&gt;'char'&lt;/span&gt;&lt;/p&gt;
 
&lt;p class="cl"&gt;)&lt;/p&gt;
&lt;/div&gt; 
&lt;p&gt;&amp;nbsp;This is the error msg you got:&lt;/p&gt;
 
&lt;p&gt;&lt;font color="#ff0000"&gt;Msg 4863, Level 16, State 1, Line 3&lt;br&gt;Bulk load data conversion error (truncation) for row 1, column 2 (Col2).&lt;/font&gt;&lt;/p&gt;
 
&lt;p&gt;Believe me, this is not a format file issue, you'll get similar errors if you provide a format file. But this will work:&lt;/p&gt;
 
&lt;p&gt;Data2.txt (save as Tab Delimited)&lt;/p&gt;
 
&lt;p&gt;-------------&lt;/p&gt;
 
&lt;p&gt;TEST 008000000380000004&lt;br&gt;TEST 008000000180000005&lt;br&gt;TEST 008000000180000063  &lt;/p&gt;
&lt;p&gt;This exactly proves how BULK INSERT works inside SQL server, i.e. BULK INSERT sends the parsed Rowset to Query Engine directly, won't be bothered to do anything else. (For a good explanation on BULK INSERT/BCP, please go to &lt;a href="http://www.sqlmag.com"&gt;www.sqlmag.com&lt;/a&gt;, look for April 2004 issue, topic "Bulk Loading Data into SQL Server 2000".)&lt;/p&gt;
 
&lt;p&gt;But our task, if you still remember, is to load a file like this:&lt;/p&gt;
 
&lt;p&gt;Data3.txt (save as Tab Delimited, can't be a csv, right?)&lt;/p&gt;
 
&lt;p&gt;--------------&lt;/p&gt;
 
&lt;p&gt;TEST 3,4&lt;br&gt;TEST 1,5&lt;br&gt;TEST 1,99  &lt;/p&gt;
&lt;p&gt;&amp;nbsp;Please spend your time to play with this, see if you can get it BULK INSERTed, with or without format file. (In case you really got through, please let me know immediately, even it's 4am in the morning.)&lt;/p&gt;
 
&lt;p&gt;&amp;nbsp;IT WON'T WORK!&lt;/p&gt;
 
&lt;p&gt;The reason according to me: all bulk operations are designed for a single purpose, i.e. -- BULK operation. So BULK INSERT won't invoke Point.Parse(SqlString s) at all, it just waiting there for you to give it some binary to pass to the Engine to write to the data file without any further change. This is actually provable, by using Debug technique, e.g. set break point inside Parse(...) method, then fire up BULK statement inside SSMS.&lt;/p&gt;
 
&lt;p&gt;&amp;nbsp;SO WHAT'S THE SOLUTION?&lt;/p&gt;
 &lt;div class="cf"&gt; 
&lt;p class="cl"&gt;&lt;span class="cb3"&gt;--solution:&lt;/span&gt;&lt;/p&gt;
 
&lt;p class="cl"&gt;&lt;span class="cb1"&gt;INSERT INTO &lt;/span&gt;dbo.T1&lt;/p&gt;
 
&lt;p class="cl"&gt;&lt;span class="cb1"&gt;SELECT &lt;/span&gt;TEM.Col1, &lt;span class="cb1"&gt;CAST&lt;/span&gt;(TEM.Col2 &lt;span class="cb1"&gt;AS &lt;/span&gt;Point)&lt;/p&gt;
 
&lt;p class="cl"&gt;&lt;span class="cb1"&gt;FROM&lt;/span&gt;&lt;/p&gt;
 
&lt;p class="cl"&gt;&lt;span class="cb1"&gt;OPENROWSET&lt;/span&gt;(&lt;/p&gt;
 
&lt;p class="cl"&gt;&lt;span class="cb1"&gt;BULK &lt;/span&gt;&lt;span class="cb2"&gt;'D:\DongDoc\SQL Server Management Studio\Projects\UDT_Point\Data3.txt'&lt;/span&gt;&lt;/p&gt;
 
&lt;p class="cl"&gt;,FORMATFILE = &lt;span class="cb2"&gt;'D:\DongDoc\SQL Server Management Studio\Projects\UDT_Point\format.fmt'&lt;/span&gt;)&lt;/p&gt;
 
&lt;p class="cl"&gt;&lt;span class="cb1"&gt;AS &lt;/span&gt;TEM&lt;/p&gt;
&lt;/div&gt; 
&lt;p&gt;&amp;nbsp;format.fmt (save as Tab Delimited)&lt;/p&gt;
 
&lt;p&gt;----------------&lt;/p&gt;
 
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
 
&lt;p&gt;9.0&lt;br&gt;2&lt;br&gt;1 SQLCHAR 0 10 "\t" 1 Col1 SQL_Latin1_General_CP1_CI_AS&lt;br&gt;2 SQLCHAR 0 20 "\r\n" 2 Col2 SQL_Latin1_General_CP1_CI_AS  &lt;/p&gt;
&lt;p&gt;&amp;nbsp;(note: the length of 20 is somewhat arbitrary).&lt;/p&gt;
 
&lt;p&gt;&amp;nbsp;According to Sunil Agarwal of SQL Server Storage Engine Group at Microsoft,&amp;nbsp;who is responsible for concurrency, indexes, tempdb, LOBS, supportability, and bulk import/export, this could be the only solution&amp;nbsp;for our task. The original discussion with him can be found &lt;a href="http://blogs.msdn.com/sqlserverstorageengine/archive/2006/05/30/Preprocessing-data-before-bulk-import.aspx" target="_blank"&gt;here&lt;/a&gt;. Also according to Sunil, this solution is still a streamed process, not a staged one. Yet beware the performance impact, for a million Point you have in the flat file, that's a million call to Point.Parse(),&amp;nbsp;try write your code well.&lt;/p&gt;
 
&lt;p&gt;&amp;nbsp;So our hero who comes to the rescue is: OPENROWSET(BULK) statement. Enjoy!&lt;/p&gt;
 
&lt;p&gt;&lt;a href="http://sqlblogcasts.com/blogs/dong/WindowsLiveWriter/HowtoBULKINSERTyourUserDefinedTypesUDT_D287/image%7B0%7D%5B16%5D.png"&gt;&lt;img src="http://sqlblogcasts.com/blogs/dong/WindowsLiveWriter/HowtoBULKINSERTyourUserDefinedTypesUDT_D287/image%7B0%7D%5B15%5D.png" style="border-width:0px;" border="0" height="240" width="176"&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=1424" width="1" height="1"&gt;</content><author><name>dong</name><uri>http://sqlblogcasts.com/members/dong.aspx</uri></author><category term="SQL Deep" scheme="http://sqlblogcasts.com/blogs/dong/archive/tags/SQL+Deep/default.aspx" /></entry><entry><title>SQL IO Simulator</title><link rel="alternate" type="text/html" href="http://sqlblogcasts.com/blogs/dong/archive/2006/09/25/1110.aspx" /><id>http://sqlblogcasts.com/blogs/dong/archive/2006/09/25/1110.aspx</id><published>2006-09-25T11:47:00Z</published><updated>2006-09-25T11:47:00Z</updated><content type="html">&lt;p&gt;This is the new&amp;nbsp;tool to replace SQLIOStress.&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;a href="http://solidqualitylearning.com/blogs/gianluca/archive/2006/09/21/sqliosimrelease.aspx"&gt;Link to SQL IO Simulator&lt;/a&gt;&lt;/p&gt;&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=1110" width="1" height="1"&gt;</content><author><name>dong</name><uri>http://sqlblogcasts.com/members/dong.aspx</uri></author><category term="SQL IO" scheme="http://sqlblogcasts.com/blogs/dong/archive/tags/SQL+IO/default.aspx" /></entry><entry><title>Confusing Bug: ASP.NET customer control refuse to work</title><link rel="alternate" type="text/html" href="http://sqlblogcasts.com/blogs/dong/archive/2006/08/09/929.aspx" /><id>http://sqlblogcasts.com/blogs/dong/archive/2006/08/09/929.aspx</id><published>2006-08-09T19:07:00Z</published><updated>2006-08-09T19:07:00Z</updated><content type="html">I was converting a VS.net 2003 web application into VS 2005 project. Hundreds bugs turned up. I know that some of the bugs are not real, they are there only because other real bugs, but the compiler will complain them anyway. Here comes the Wisdom to choose which file to fix first, sadly, I haven't got much of it.&lt;br&gt;&lt;br&gt;Noticed an error message complaining about this line in a .ascx file:&lt;br&gt;&amp;lt;MyTag:MyControl1 id="control1" runat="server" /&amp;gt;&lt;br&gt;&lt;br&gt;I found the Directive line at the top:&lt;br&gt;&amp;lt;%@ Register TagPrefix="MyTag" Namespace="MyNameSpace" Assembly="MyAssembly" %&amp;gt;&lt;br&gt;&lt;br&gt;Since my control code is inside the \App_Code folder now (that's new in VS 05), there won't be an DLL file to refer to, so I removed the &lt;i&gt;Assembly="MyAssembly" &lt;/i&gt;pair. Still, it doesn't work. Stared at the code for a long time, can't figure any error there. So I created a new web project, added the control code into \App_Code, declared my tag, it WORKs.&lt;br&gt;&lt;br&gt;Only at this point, my rational thinking comes back from a beach holiday (I guess). Since \App_Code is holding lots of code files, VS 05 must be compiling it to a temp place, i.e. the whole folder into a single DLL, to be referenced by webforms, if a single bug in &lt;b&gt;any files&lt;/b&gt; prevents this DLL to be compiled, then you just don't have that dll, then, you have nothing at all.&lt;br&gt;&lt;br&gt;So, my customer control code is bug free, .ascx file too. It's some other files I should look at, really!&lt;br&gt;&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=929" width="1" height="1"&gt;</content><author><name>dong</name><uri>http://sqlblogcasts.com/members/dong.aspx</uri></author><category term="ASP.NET" scheme="http://sqlblogcasts.com/blogs/dong/archive/tags/ASP.NET/default.aspx" /><category term="Confusing Bug" scheme="http://sqlblogcasts.com/blogs/dong/archive/tags/Confusing+Bug/default.aspx" /></entry><entry><title>Montecito released! Finally!</title><link rel="alternate" type="text/html" href="http://sqlblogcasts.com/blogs/dong/archive/2006/07/20/907.aspx" /><id>http://sqlblogcasts.com/blogs/dong/archive/2006/07/20/907.aspx</id><published>2006-07-20T14:48:00Z</published><updated>2006-07-20T14:48:00Z</updated><content type="html">Intel announced the release of the first dual core Itanium 2 chip: code named Montecito, about yesterday. Although not very much the same specification as disclosed two months ago, e.g. the MHz, FSB, etc. But I think it will do good compared with the single core old Madison.&lt;br&gt;&lt;br&gt;Bull has the new model with details on their website. Unisys also has news about that. But nothing was mentioned on HP's web, if you consider ~80% of Itanium boxes sold are HP branded. Oh, I did find one thing there under the Offer section, seems HP is trying to clear stock with a Buy one (CPU) get one free offer.&lt;br&gt;&lt;br&gt;That all said, I personally love the new&amp;nbsp;
&lt;a href="http://www.bull.com/catalogue/details.asp?tmp=novascale&amp;amp;opt=ns3045s&amp;amp;dt=ft&amp;amp;c=Y"&gt;Bull NovaScale 3045&lt;/a&gt;, a 4U 4 processor system. The reason is it's new chipset. Montecito chip is dual core, HT enabled, that's 4 threads in total, a data crunch monster really. How to feed enough food to it is a big issue, if you aware that Intel hasn't been able to embed the memory controller into the CPU, thus a Northbridge chip is there, also the Front side bus (FSB), the limiting bottle-neck.&lt;br&gt;&lt;br&gt;

&lt;img src="http://www.intel.com/products/i/chipsets/e8870/e8870_diag_580.jpg"&gt;&lt;br&gt;&lt;i&gt;Figure 1. Intel's 8870 chipset diagram&lt;/i&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;

&lt;img src="http://www.intel.com/products/i/chipsets/e8870sp/e8870_blkdiag_8way_800.jpg" height="272" width="400"&gt;&lt;br&gt;&lt;i&gt;Figure 2. Intel's 8870sp chipset.&lt;/i&gt;&lt;br&gt;&lt;br&gt;If you look carefully, you'll notice that, both chipsets are providing a single FSB to FOUR Montecito, that's 16 threads in total. You'll understand what I'm saying here if you ever drive at 4pm on M25.&lt;br&gt;&lt;br&gt;Bull's 3045 is using a new custome build chipset, with, Two FSB. So each FSB only deal with 2 processors. (Other series from Bull hasn't got this far). Shipping time: August.&lt;br&gt;&lt;br&gt;This is really a long wait. I have been trying to get a Montecito box since Mar 2005, when I was at the 64bit trainning course at Microsoft Chertsey... ...&lt;br&gt;&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=907" width="1" height="1"&gt;</content><author><name>dong</name><uri>http://sqlblogcasts.com/members/dong.aspx</uri></author><category term="Hardware" scheme="http://sqlblogcasts.com/blogs/dong/archive/tags/Hardware/default.aspx" /></entry><entry><title>SSIS Lookup Transformation Dynamic SQL workaround</title><link rel="alternate" type="text/html" href="http://sqlblogcasts.com/blogs/dong/archive/2006/07/13/889.aspx" /><link rel="enclosure" type="image/png" length="11628" href="http://sqlblogcasts.com/blogs/dong/attachment/889.ashx" /><id>http://sqlblogcasts.com/blogs/dong/archive/2006/07/13/889.aspx</id><published>2006-07-13T14:17:00Z</published><updated>2006-07-13T14:17:00Z</updated><content type="html">In SSIS, Lookup Transformation is really an important tool. But the design of it prevents user to set the SQL statement dynamicly.&lt;br&gt;&lt;br&gt;In my work, I need to prepare a text file for BULK loading into table. The original csv file could be 10 million ~ 1 billion rows. On the way I need to lookup several IDs by Names from different tables. These reference tables all have a Project_ID column, which can sub-grouping data for a specific project. Normally the original csv file only holds data for a single project.&lt;br&gt;&lt;br&gt;Of cause I can just do:&lt;br&gt;&lt;font size="2"&gt;&lt;span&gt;&lt;br&gt;&lt;span&gt;SELECT&lt;/span&gt; xx_ID, xx_Name &lt;span&gt;FROM&lt;/span&gt; dbo.TABLE1&lt;/span&gt;&lt;/font&gt;&lt;br&gt;&lt;br&gt;to fill the Lookup Tran with full cache. But doing this will: use lots of memory; waste resource; and bad performance.&lt;br&gt;&lt;br&gt;I would rather want to do:&lt;br&gt;&lt;br&gt;&lt;font size="2"&gt;&lt;span&gt;&lt;span&gt;SELECT&lt;/span&gt; xx_ID, xx_Name &lt;span&gt;FROM&lt;/span&gt; dbo.TABLE1&lt;/span&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;span&gt; &lt;span&gt;WHERE&lt;/span&gt; Project_ID = ?&lt;/span&gt;&lt;/font&gt;&lt;br&gt;&lt;br&gt;Which the Project_ID value is only known at runtime by user input parameter. Unfortunately Lookup Tran does not have that enabled (yet, maybe will in future version.)&lt;br&gt;&lt;br&gt;So I came up with this idea: BCP dump + OPENROWSET (BULK). &lt;br&gt;&lt;br&gt;First we use an Execute Process Task, to call Bcp.exe, specify the Arguments using Expressions, the Project_ID will be a SSIS variable. This is like you run this line in CMD:&lt;br&gt;&lt;br&gt;c:\Bcp.exe "&lt;font size="2"&gt;&lt;span&gt;&lt;span&gt;SELECT&lt;/span&gt; xx_ID, xx_Name &lt;span&gt;FROM&lt;/span&gt; dbo.TABLE1&lt;/span&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;span&gt; &lt;span&gt;WHERE&lt;/span&gt; Project_ID = 101" queryout tempref1.txt -N -T&lt;br&gt;&lt;/span&gt;&lt;/font&gt;&lt;br&gt;Then you will get a text file with columns you want, for the project that is relevant to this run. The reason to specify -N is to save char like in unicode and everything else in SQL server native format, this can save a lot both on file size and I/O speed for later reading process.&lt;br&gt;&lt;br&gt;Second step, configure our Lookup Trans by set it to Use results of an SQL query, the query should be like this:&lt;br&gt;&lt;br&gt;&lt;font size="2"&gt;&lt;span&gt;&lt;span&gt;SELECT&lt;/span&gt; a.* &lt;span&gt;FROM&lt;/span&gt; &lt;span&gt;OPENROWSET&lt;/span&gt;( &lt;span&gt;BULK&lt;/span&gt; 'c:\tempref1.txt', FORMATFILE = 'c:\tempref1.fmt') AS a&lt;/span&gt;&lt;/font&gt;&lt;br&gt;&lt;br&gt;I didn't mention the step to create the format file.&lt;br&gt;&lt;br&gt;If the SQL statement is correct and both the txt and fmt files are ok, when you click the Preview button, you'll see a data grid. Then just continue your normal configuration of Lookup Trans.&lt;br&gt;&lt;br&gt;So far this works for my situation. I can do multiple Lookups by Bcp to different file name. Obviously I can't fire two instances of the package at the same time. Also I can't set the path and file name at runtime too.&lt;br&gt;&lt;br&gt;Any comments are welcomed! (Maybe I can do a sample package if anyone interested, in Northwind or AdventureWorks context?)&lt;br&gt;&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=889" width="1" height="1"&gt;</content><author><name>dong</name><uri>http://sqlblogcasts.com/members/dong.aspx</uri></author><category term="SSIS" scheme="http://sqlblogcasts.com/blogs/dong/archive/tags/SSIS/default.aspx" /></entry></feed>