<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;D0MBSHg4eyp7ImA9WxJVE04.&quot;"><id>tag:blogger.com,1999:blog-36623110</id><updated>2009-06-30T09:47:39.633+05:30</updated><title>DB Antics</title><subtitle type="html">&lt;b&gt;Microsoft SQL Server&lt;/b&gt; | &lt;b&gt;Data Warehousing&lt;/b&gt; | &lt;b&gt;Business Intelligence&lt;/b&gt;&lt;br&gt;&lt;br&gt;&lt;hr&gt;
Ideas expressed in this blog are of mine alone. Solutions or technical content are not guaranteed to be flawless. Bouquets and brickbats are welcome with open mindedness...</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://dbantics.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://dbantics.blogspot.com/" /><author><name>Gogula G. Aryalingam</name><uri>http://www.blogger.com/profile/17902540052308703629</uri><email>noreply@blogger.com</email></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>20</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><link rel="self" href="http://feeds.feedburner.com/DBAntics" type="application/atom+xml" /><entry gd:etag="W/&quot;AkMGQnY9fip7ImA9WxJWGUU.&quot;"><id>tag:blogger.com,1999:blog-36623110.post-5808959434765862815</id><published>2009-06-26T01:40:00.001+05:30</published><updated>2009-06-26T09:23:43.866+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-26T09:23:43.866+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Attaching Databases" /><category scheme="http://www.blogger.com/atom/ns#" term="Recovery" /><title>Hey Doc, can we attach only the data file in SQL Server?</title><content type="html">&lt;p align="justify"&gt;“Hey Doc, I have salvaged the MDF file of an important database. Can I attach it to SQL Server in order to use it?” was the question from an old colleague.&lt;/p&gt;  &lt;p align="justify"&gt;Yes, you can…&lt;/p&gt;  &lt;p align="justify"&gt;“And oh! I don’t have the log file. And I renamed the MDF file by mistake too.”&lt;/p&gt;  &lt;p align="justify"&gt;No problem…&lt;/p&gt;  &lt;p align="justify"&gt;This is how you do it…&lt;/p&gt;  &lt;p align="justify"&gt;When you bring up the &lt;em&gt;Attach Databases&lt;/em&gt; dialog and select the salvaged and renamed file, you would see the following situation on it (&lt;em&gt;&lt;font size="1"&gt;click on image for larger view&lt;/font&gt;&lt;/em&gt;).&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_ekbL4Mfw8E0/SkRFEilWBrI/AAAAAAAAAMM/DEG9gUq_bZ0/s1600-h/Attach_01%5B7%5D.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Attach_01" border="0" alt="Attach_01" src="http://lh5.ggpht.com/_ekbL4Mfw8E0/SkRFH7Wl09I/AAAAAAAAAMQ/R-FBURH4EZg/Attach_01_thumb%5B5%5D.jpg?imgmax=800" width="659" height="422" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p align="justify"&gt;The second grid lists the original database files followed by the &lt;em&gt;Not Found&lt;/em&gt; message. This is obviously since you do not have them in the original location. At this stage you cannot move ahead by clicking on &lt;em&gt;OK&lt;/em&gt;. You will have to remove both the entries using the &lt;em&gt;Re&lt;u&gt;m&lt;/u&gt;ove&lt;/em&gt; button below that grid.&lt;/p&gt;  &lt;p align="justify"&gt;Then you have to add the new data file; click on the &lt;em&gt;Add &lt;u&gt;C&lt;/u&gt;atalog&lt;/em&gt; button, then browse and select the new MDF file (the one which you had salvaged and renamed). You can then optionally change the name of the new (to be attached) database from the &lt;em&gt;Attach As&lt;/em&gt; textbox.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_ekbL4Mfw8E0/SkRFLO7CkXI/AAAAAAAAAMU/t-jrOlSuRWU/s1600-h/Attach_03%5B9%5D.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Attach_03" border="0" alt="Attach_03" src="http://lh3.ggpht.com/_ekbL4Mfw8E0/SkRFO69_RbI/AAAAAAAAAMY/A6X5AY5aHuM/Attach_03_thumb%5B7%5D.jpg?imgmax=800" width="660" height="439" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p align="justify"&gt;Click on &lt;em&gt;OK &lt;/em&gt;and &lt;em&gt;Voila!&lt;/em&gt;,&lt;em&gt; &lt;/em&gt;you’ve got your old database back.&lt;/p&gt; &lt;span class="sbmLink"&gt;   &lt;table cellspacing="1" cellpadding="1"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td class="sbmText"&gt;Share this post : &lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to Social!" href="http://social.microsoft.com/en-us/action/create/s/E/?url=http://dbantics.blogspot.com/2009/06/hey-doc-can-we-attach-only-data-file-in.html&amp;amp;ttl=Hey Doc, can we attach only the data file in SQL Server?" target="_blank"&gt;&lt;img border="0" src="http://www.dotnetscraps.com/dotnetscraps/samples/sbmtool/social.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to MSDN!" href="http://social.msdn.microsoft.com/en-us/action/create/s/E/?url=http://dbantics.blogspot.com/2009/06/hey-doc-can-we-attach-only-data-file-in.html&amp;amp;ttl=Hey Doc, can we attach only the data file in SQL Server?" target="_blank"&gt;&lt;img border="0" src="http://www.dotnetscraps.com/dotnetscraps/samples/sbmtool/msdn.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to Technet!" href="http://social.technet.microsoft.com/en-us/action/create/s/E/?url=http://dbantics.blogspot.com/2009/06/hey-doc-can-we-attach-only-data-file-in.html&amp;amp;ttl=Hey Doc, can we attach only the data file in SQL Server?" target="_blank"&gt;&lt;img border="0" src="http://www.dotnetscraps.com/dotnetscraps/samples/sbmtool/technet.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to Expression!" href="http://social.expression.microsoft.com/en-us/action/create/s/E/?url=http://dbantics.blogspot.com/2009/06/hey-doc-can-we-attach-only-data-file-in.html&amp;amp;ttl=Hey Doc, can we attach only the data file in SQL Server?" target="_blank"&gt;&lt;img border="0" src="http://www.dotnetscraps.com/dotnetscraps/samples/sbmtool/expression.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to backflip" href="http://www.backflip.com/add_page_pop.ihtml?url=http://dbantics.blogspot.com/2009/06/hey-doc-can-we-attach-only-data-file-in.html&amp;amp;title=Hey Doc, can we attach only the data file in SQL Server?" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/backflip4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to blinkbits!" href="http://www.blinkbits.com/bookmarklets/save.php?v=1&amp;amp;source_url=http://dbantics.blogspot.com/2009/06/hey-doc-can-we-attach-only-data-file-in.html&amp;amp;title=Hey Doc, can we attach only the data file in SQL Server?" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/blinkbit4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to blogmemes" href="http://www.blogmemes.net/post.php?url=http://dbantics.blogspot.com/2009/06/hey-doc-can-we-attach-only-data-file-in.html&amp;amp;title=Hey Doc, can we attach only the data file in SQL Server?" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/blogmemes4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to buddymark" href="http://buddymarks.com/s_add_bookmark.php?bookmark_url=http://dbantics.blogspot.com/2009/06/hey-doc-can-we-attach-only-data-file-in.html&amp;amp;bookmark_title=Hey Doc, can we attach only the data file in SQL Server?" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/buddymar4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to complore" href="http://complore.com?q=node/add/flexinode-5&amp;amp;url=http://dbantics.blogspot.com/2009/06/hey-doc-can-we-attach-only-data-file-in.html&amp;amp;title=Hey Doc, can we attach only the data file in SQL Server?" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/complore4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to del.icio.us" href="http://del.icio.us/post?url=http://dbantics.blogspot.com/2009/06/hey-doc-can-we-attach-only-data-file-in.html&amp;amp;;title=Hey Doc, can we attach only the data file in SQL Server?" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/deliciou4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to del.iri.ous!" href="http://de.lirio.us/bookmarks/sbmtool?action=add&amp;amp;address=http://dbantics.blogspot.com/2009/06/hey-doc-can-we-attach-only-data-file-in.html&amp;amp;title=Hey Doc, can we attach only the data file in SQL Server?" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/deliriou4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to digg" href="http://digg.com/submit?phase=2&amp;amp;url=http://dbantics.blogspot.com/2009/06/hey-doc-can-we-attach-only-data-file-in.html&amp;amp;title=Hey Doc, can we attach only the data file in SQL Server?" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/digg14.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to dotnetkicks" href="http://www.dotnetkicks.com/kick/?url=http://dbantics.blogspot.com/2009/06/hey-doc-can-we-attach-only-data-file-in.html&amp;amp;title=Hey Doc, can we attach only the data file in SQL Server?" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/CropperCapture154.jpg" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to Facebook" href="http://www.facebook.com/sharer.php?u=http://dbantics.blogspot.com/2009/06/hey-doc-can-we-attach-only-data-file-in.html&amp;amp;t=Hey Doc, can we attach only the data file in SQL Server?" target="_blank"&gt;&lt;img border="0" src="http://blogs.technet.com/photos/james/images/1765319/original.aspx" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to furl" href="http://www.furl.net/store?s=f&amp;amp;to=0&amp;amp;u=http://dbantics.blogspot.com/2009/06/hey-doc-can-we-attach-only-data-file-in.html&amp;amp;ti=Hey Doc, can we attach only the data file in SQL Server?" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/furl4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to live" href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;amp;mkt=en-us&amp;amp;url=http://dbantics.blogspot.com/2009/06/hey-doc-can-we-attach-only-data-file-in.html&amp;amp;title=Hey Doc, can we attach only the data file in SQL Server?" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/live4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to magnolia!" href="http://ma.gnolia.com/bookmarklet/add?url=http://dbantics.blogspot.com/2009/06/hey-doc-can-we-attach-only-data-file-in.html&amp;amp;title=Hey Doc, can we attach only the data file in SQL Server?" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/magnolia4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to netvouz!" href="http://netvouz.com/action/submitBookmark?url=http://dbantics.blogspot.com/2009/06/hey-doc-can-we-attach-only-data-file-in.html&amp;amp;title=Hey Doc, can we attach only the data file in SQL Server?" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/netvouz4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to reddit!" href="http://reddit.com/submit?url=http://dbantics.blogspot.com/2009/06/hey-doc-can-we-attach-only-data-file-in.html&amp;amp;title=Hey Doc, can we attach only the data file in SQL Server?" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/reddit4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to shadow" href="http://www.shadows.com/bookmark/saveLink.rails?page=http://dbantics.blogspot.com/2009/06/hey-doc-can-we-attach-only-data-file-in.html&amp;amp;title=Hey Doc, can we attach only the data file in SQL Server?" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/shadows6.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to spurl" href="http://www.spurl.net/spurl.php?v=3&amp;amp;url=http://dbantics.blogspot.com/2009/06/hey-doc-can-we-attach-only-data-file-in.html&amp;amp;title=Hey Doc, can we attach only the data file in SQL Server?" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/spurl8.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to technorati!" href="http://technorati.com/faves/?add=http://dbantics.blogspot.com/2009/06/hey-doc-can-we-attach-only-data-file-in.html&amp;amp;title=Hey Doc, can we attach only the data file in SQL Server?" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/technora4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to wists" href="http://www.wists.com/?action=add&amp;amp;url=http://dbantics.blogspot.com/2009/06/hey-doc-can-we-attach-only-data-file-in.html&amp;amp;title=Hey Doc, can we attach only the data file in SQL Server?" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/wists9.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to yahoo!" href="http://myweb.yahoo.com/myresults/bookmarklet?u=http://dbantics.blogspot.com/2009/06/hey-doc-can-we-attach-only-data-file-in.html&amp;amp;t=Hey Doc, can we attach only the data file in SQL Server?" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/yahoo9.png" /&gt;&lt;/a&gt;&lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/span&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36623110-5808959434765862815?l=dbantics.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://dbantics.blogspot.com/feeds/5808959434765862815/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dbantics.blogspot.com/2009/06/hey-doc-can-we-attach-only-data-file-in.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/36623110/posts/default/5808959434765862815?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/36623110/posts/default/5808959434765862815?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DBAntics/~3/xeItEMQyRcU/hey-doc-can-we-attach-only-data-file-in.html" title="Hey Doc, can we attach only the data file in SQL Server?" /><author><name>Gogula G. Aryalingam</name><uri>http://www.blogger.com/profile/17902540052308703629</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="00699112592523224881" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://dbantics.blogspot.com/2009/06/hey-doc-can-we-attach-only-data-file-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkYGR34zeip7ImA9WxJWEEU.&quot;"><id>tag:blogger.com,1999:blog-36623110.post-906592614198122223</id><published>2009-06-15T14:08:00.004+05:30</published><updated>2009-06-15T23:18:46.082+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-15T23:18:46.082+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Time data type" /><category scheme="http://www.blogger.com/atom/ns#" term="T-SQL" /><category scheme="http://www.blogger.com/atom/ns#" term="GETDATE()" /><title>Obtaining the Current Time</title><content type="html">&lt;p style="text-align: justify;"&gt;As we all know, SQL Server 2008 comes with a &lt;em&gt;time&lt;/em&gt; data type. Obviously, as the name itself denotes, this data type is capable of storing the time sans the date component. So, how would one populate a &lt;em&gt;time&lt;/em&gt; field or variable with the current system time? One would obviously think of the &lt;em&gt;getdate()&lt;/em&gt; function and some fancy operations to extract the time component out of it. At least, that is what I thought. But, the answer is much more simpler:&lt;/p&gt;  &lt;div id="codeSnippetWrapper" class="csharpcode-wrapper"&gt;   &lt;div class="csharpcode"&gt;     &lt;div    style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background- margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px;  direction: ltr; max-height: 200px;  overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4pxfont-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;" id="codeSnippetWrapper"&gt;       &lt;div    style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:'Courier New', courier, monospace;font-size:8pt;color:black;" id="codeSnippet"&gt;         &lt;pre    style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:'Courier New', courier, monospace;font-size:8pt;color:black;"&gt;&lt;span style="color:#0000ff;"&gt;DECLARE&lt;/span&gt; @CurrentTime &lt;span style="color:#0000ff;"&gt;time&lt;/span&gt;&lt;/pre&gt;        &lt;pre    style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:'Courier New', courier, monospace;font-size:8pt;color:black;"&gt;&lt;span style="color:#0000ff;"&gt;SET&lt;/span&gt; @CurrentTime = GETDATE()&lt;/pre&gt;        &lt;pre    style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:'Courier New', courier, monospace;font-size:8pt;color:black;"&gt;&lt;span style="color:#0000ff;"&gt;SELECT&lt;/span&gt; @CurrentTime&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="line-height: 16px;"&gt;&lt;br /&gt;&lt;/span&gt;  &lt;div class="csharpcode"&gt;&lt;a href="http://lh3.ggpht.com/_ekbL4Mfw8E0/SjYIdDBwGNI/AAAAAAAAAL0/Y68DH2pGdCs/s1600-h/TimeDataTypeResults%5B2%5D.jpg" style="text-decoration: none;"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="TimeDataTypeResults" border="0" alt="TimeDataTypeResults" src="http://lh5.ggpht.com/_ekbL4Mfw8E0/SjYIfiDYocI/AAAAAAAAAL4/xNDPYYwlnZM/TimeDataTypeResults_thumb.jpg?imgmax=800" width="160" height="71" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="csharpcode"&gt;&lt;br /&gt;&lt;/div&gt;&lt;span class="sbmLink"&gt;&lt;table cellspacing="1" cellpadding="1"&gt;&lt;tbody&gt;        &lt;tr&gt;          &lt;td class="sbmText"&gt;Share this post : &lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to Social!" href="http://social.microsoft.com/en-us/action/create/s/E/?url=http://dbantics.blogspot.com/2009/06/obtaining-current-time.html&amp;amp;ttl=Obtaining%20the%20current%20time" target="_blank"&gt;&lt;img border="0" src="http://www.dotnetscraps.com/dotnetscraps/samples/sbmtool/social.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to MSDN!" href="http://social.msdn.microsoft.com/en-us/action/create/s/E/?url=http://dbantics.blogspot.com/2009/06/obtaining-current-time.html&amp;amp;ttl=Obtaining%20the%20current%20time" target="_blank"&gt;&lt;img border="0" src="http://www.dotnetscraps.com/dotnetscraps/samples/sbmtool/msdn.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to Technet!" href="http://social.technet.microsoft.com/en-us/action/create/s/E/?url=http://dbantics.blogspot.com/2009/06/obtaining-current-time.html&amp;amp;ttl=Obtaining%20the%20current%20time" target="_blank"&gt;&lt;img border="0" src="http://www.dotnetscraps.com/dotnetscraps/samples/sbmtool/technet.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to Expression!" href="http://social.expression.microsoft.com/en-us/action/create/s/E/?url=http://dbantics.blogspot.com/2009/06/obtaining-current-time.html&amp;amp;ttl=Obtaining%20the%20current%20time" target="_blank"&gt;&lt;img border="0" src="http://www.dotnetscraps.com/dotnetscraps/samples/sbmtool/expression.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to backflip" href="http://www.backflip.com/add_page_pop.ihtml?url=http://dbantics.blogspot.com/2009/06/obtaining-current-time.html&amp;amp;title=Obtaining%20the%20current%20time" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/backflip4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to blinkbits!" href="http://www.blinkbits.com/bookmarklets/save.php?v=1&amp;amp;source_url=http://dbantics.blogspot.com/2009/06/obtaining-current-time.html&amp;amp;title=Obtaining%20the%20current%20time" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/blinkbit4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to blogmemes" href="http://www.blogmemes.net/post.php?url=http://dbantics.blogspot.com/2009/06/obtaining-current-time.html&amp;amp;title=Obtaining%20the%20current%20time" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/blogmemes4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to buddymark" href="http://buddymarks.com/s_add_bookmark.php?bookmark_url=http://dbantics.blogspot.com/2009/06/obtaining-current-time.html&amp;amp;bookmark_title=Obtaining%20the%20current%20time" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/buddymar4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to complore" href="http://complore.com/?q=node/add/flexinode-5&amp;amp;url=http://dbantics.blogspot.com/2009/06/obtaining-current-time.html&amp;amp;title=Obtaining%20the%20current%20time" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/complore4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to del.icio.us" href="http://del.icio.us/post?url=http://dbantics.blogspot.com/2009/06/obtaining-current-time.html&amp;amp;;title=Obtaining%20the%20current%20time" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/deliciou4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to del.iri.ous!" href="http://de.lirio.us/bookmarks/sbmtool?action=add&amp;amp;address=http://dbantics.blogspot.com/2009/06/obtaining-current-time.html&amp;amp;title=Obtaining%20the%20current%20time" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/deliriou4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to digg" href="http://digg.com/submit?phase=2&amp;amp;url=http://dbantics.blogspot.com/2009/06/obtaining-current-time.html&amp;amp;title=Obtaining%20the%20current%20time" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/digg14.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to dotnetkicks" href="http://www.dotnetkicks.com/kick/?url=http://dbantics.blogspot.com/2009/06/obtaining-current-time.html&amp;amp;title=Obtaining%20the%20current%20time" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/CropperCapture154.jpg" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to Facebook" href="http://www.facebook.com/sharer.php?u=http://dbantics.blogspot.com/2009/06/obtaining-current-time.html&amp;amp;t=Obtaining%20the%20current%20time" target="_blank"&gt;&lt;img border="0" src="http://blogs.technet.com/photos/james/images/1765319/original.aspx" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to furl" href="http://www.furl.net/store?s=f&amp;amp;to=0&amp;amp;u=http://dbantics.blogspot.com/2009/06/obtaining-current-time.html&amp;amp;ti=Obtaining%20the%20current%20time" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/furl4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to live" href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;amp;mkt=en-us&amp;amp;url=http://dbantics.blogspot.com/2009/06/obtaining-current-time.html&amp;amp;title=Obtaining%20the%20current%20time" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/live4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to magnolia!" href="http://ma.gnolia.com/bookmarklet/add?url=http://dbantics.blogspot.com/2009/06/obtaining-current-time.html&amp;amp;title=Obtaining%20the%20current%20time" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/magnolia4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to netvouz!" href="http://netvouz.com/action/submitBookmark?url=http://dbantics.blogspot.com/2009/06/obtaining-current-time.html&amp;amp;title=Obtaining%20the%20current%20time" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/netvouz4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to reddit!" href="http://reddit.com/submit?url=http://dbantics.blogspot.com/2009/06/obtaining-current-time.html&amp;amp;title=Obtaining%20the%20current%20time" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/reddit4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to shadow" href="http://www.shadows.com/bookmark/saveLink.rails?page=http://dbantics.blogspot.com/2009/06/obtaining-current-time.html&amp;amp;title=Obtaining%20the%20current%20time" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/shadows6.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to spurl" href="http://www.spurl.net/spurl.php?v=3&amp;amp;url=http://dbantics.blogspot.com/2009/06/obtaining-current-time.html&amp;amp;title=Obtaining%20the%20current%20time" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/spurl8.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to technorati!" href="http://technorati.com/faves/?add=http://dbantics.blogspot.com/2009/06/obtaining-current-time.html&amp;amp;title=Obtaining%20the%20current%20time" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/technora4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to wists" href="http://www.wists.com/?action=add&amp;amp;url=http://dbantics.blogspot.com/2009/06/obtaining-current-time.html&amp;amp;title=Obtaining%20the%20current%20time" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/wists9.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to yahoo!" href="http://myweb.yahoo.com/myresults/bookmarklet?u=http://dbantics.blogspot.com/2009/06/obtaining-current-time.html&amp;amp;t=Obtaining%20the%20current%20time" target="_blank" style="text-decoration: none;"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/yahoo9.png" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36623110-906592614198122223?l=dbantics.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://dbantics.blogspot.com/feeds/906592614198122223/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dbantics.blogspot.com/2009/06/obtaining-current-time.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/36623110/posts/default/906592614198122223?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/36623110/posts/default/906592614198122223?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DBAntics/~3/PZIDJgy1eXc/obtaining-current-time.html" title="Obtaining the Current Time" /><author><name>Gogula G. Aryalingam</name><uri>http://www.blogger.com/profile/17902540052308703629</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="00699112592523224881" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://dbantics.blogspot.com/2009/06/obtaining-current-time.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkIGSHcyfCp7ImA9WxJXGEo.&quot;"><id>tag:blogger.com,1999:blog-36623110.post-1689095487090519216</id><published>2009-06-08T20:36:00.002+05:30</published><updated>2009-06-13T10:52:09.994+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-13T10:52:09.994+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SSIS" /><category scheme="http://www.blogger.com/atom/ns#" term="Intermediate Fact Table" /><category scheme="http://www.blogger.com/atom/ns#" term="Integration Services" /><category scheme="http://www.blogger.com/atom/ns#" term="Many-To-Many Dimension" /><title>Populating an Intermediate Fact Table</title><content type="html">&lt;p align="justify"&gt;This is but one scenario where and how we use an intermediate fact table. Intermediate fact tables are used in cases where you have a many-to-many relationship between two dimensions (also known as Many-to-many dimensions). To introduce a simple example:&lt;/p&gt;  &lt;p align="justify"&gt;&lt;em&gt;Imagine a bank. Account holders. Bank accounts. A bank account can be held by multiple account holders (joint account), whereas an account holder may hold multiple accounts. Transactions are usually recorded based on accounts. However, when business users need to analyze the business data they would like to analyze from the Account holder point of view as well, hence the data model may have to be put up to look something like this:&lt;/em&gt;&lt;/p&gt;  &lt;p align="justify"&gt;&lt;a href="http://lh5.ggpht.com/_ekbL4Mfw8E0/Si0o4OdLmnI/AAAAAAAAALY/i895ORtEpCI/s1600-h/IntermediateFactTable%5B5%5D.jpg"&gt;&lt;span style="color:#000000;"&gt;&lt;em&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="IntermediateFactTable" border="0" alt="IntermediateFactTable" src="http://lh5.ggpht.com/_ekbL4Mfw8E0/Si0o5Epfc2I/AAAAAAAAALc/x_HtlhQZ77E/IntermediateFactTable_thumb%5B3%5D.jpg?imgmax=800" width="415" height="248" /&gt;&lt;/em&gt;&lt;/span&gt;&lt;/a&gt;&lt;em&gt; &lt;/em&gt;&lt;/p&gt;  &lt;p align="justify"&gt;Check out these links to know more about many-to-many dimensions; &lt;a href="http://blogs.microsoft.co.il/blogs/barbaro/archive/2007/09/01/The-Many-to-Many-Relationship.aspx" target="_blank"&gt;The Many to Many Relationship&lt;/a&gt;, &lt;a href="http://technet.microsoft.com/en-us/library/ms345139.aspx" target="_blank"&gt;Many-to-Many dimensions in Analysis Services&lt;/a&gt; or try &lt;a href="http://www.bing.com/" target="_blank"&gt;binging&lt;/a&gt; it.&lt;/p&gt;  &lt;p align="justify"&gt;&lt;strong&gt;My scenario is this&lt;/strong&gt;. The source system has &lt;em&gt;Groups&lt;/em&gt; and &lt;em&gt;Users&lt;/em&gt;. Both of them have been identified as dimensions (&lt;em&gt;DimGroup&lt;/em&gt; and &lt;em&gt;DimUser&lt;/em&gt;). ETLs already created and tested. Since a user can exist in multiple groups and also obviously a group can have multiple users in them, makes this an ideal many-to-many scenario. Something simple and noteworthy in this scenario is that historical tracking is not necessary. Which means I need not store the history of a user belonging to a particular group 3 months ago and now does not.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;This is how the data population was done (image contains detailed steps)&lt;/strong&gt;:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_ekbL4Mfw8E0/Si3_wWW9kyI/AAAAAAAAALo/_v0pOsCqFjI/s1600-h/PopulatingIntermediateTable%5B1%5D.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="PopulatingIntermediateTable" border="0" alt="PopulatingIntermediateTable" src="http://lh4.ggpht.com/_ekbL4Mfw8E0/Si3-J2A_tjI/AAAAAAAAALs/CHIECZoBuA4/PopulatingIntermediateTable_thumb.jpg?imgmax=800" width="569" height="452" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p align="justify"&gt;&lt;strong&gt;Reasoning&lt;/strong&gt;: The data to be stored in the target is made up of only two columns that are composite (&lt;em&gt;GroupID&lt;/em&gt; and &lt;em&gt;UserID&lt;/em&gt;), hence using the slowly changing dimension would not do. The records that come in from the source after getting looked up for the appropriate keys in their respective dimension tables (i.e. DimGroup and DimUser) either shall be inserted if not matched with the destination (i.e. DimGroupDimUser) or be sent on their way (matching records). These matching records are right-outer-joined against records from the destination (i.e. DimGroupDimUser) in order to be deleted (where matching records’ UserID == NULL and matching records’ GroupID == NULL). There are no updates that can happen here. If an update happens at the source; a record will be deleted and another inserted at the destination (This is more or less why the Slowly Changing Dimension cannot be used in this scenario).&lt;/p&gt;  &lt;p&gt;Of course, I feel that this could be done in other (maybe even better ways). I would love to hear your comments on this.&lt;/p&gt; &lt;span class="sbmLink"&gt;   &lt;table cellspacing="1" cellpadding="1"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td class="sbmText"&gt;Share this post : &lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to Social!" href="http://social.microsoft.com/en-us/action/create/s/E/?url=http://dbantics.blogspot.com/2009/06/populating-intermediate-fact-table.html&amp;amp;ttl=Populating%20an%20Intermedate%20Fact%20Table" target="_blank"&gt;&lt;img border="0" src="http://www.dotnetscraps.com/dotnetscraps/samples/sbmtool/social.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to MSDN!" href="http://social.msdn.microsoft.com/en-us/action/create/s/E/?url=http://dbantics.blogspot.com/2009/06/populating-intermediate-fact-table.html&amp;amp;ttl=Populating%20an%20Intermedate%20Fact%20Table" target="_blank"&gt;&lt;img border="0" src="http://www.dotnetscraps.com/dotnetscraps/samples/sbmtool/msdn.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to Technet!" href="http://social.technet.microsoft.com/en-us/action/create/s/E/?url=http://dbantics.blogspot.com/2009/06/populating-intermediate-fact-table.html&amp;amp;ttl=Populating%20an%20Intermedate%20Fact%20Table" target="_blank"&gt;&lt;img border="0" src="http://www.dotnetscraps.com/dotnetscraps/samples/sbmtool/technet.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to Expression!" href="http://social.expression.microsoft.com/en-us/action/create/s/E/?url=http://dbantics.blogspot.com/2009/06/populating-intermediate-fact-table.html&amp;amp;ttl=Populating%20an%20Intermedate%20Fact%20Table" target="_blank"&gt;&lt;img border="0" src="http://www.dotnetscraps.com/dotnetscraps/samples/sbmtool/expression.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to backflip" href="http://www.backflip.com/add_page_pop.ihtml?url=http://dbantics.blogspot.com/2009/06/populating-intermediate-fact-table.html&amp;amp;title=Populating%20an%20Intermedate%20Fact%20Table" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/backflip4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to blinkbits!" href="http://www.blinkbits.com/bookmarklets/save.php?v=1&amp;amp;source_url=http://dbantics.blogspot.com/2009/06/populating-intermediate-fact-table.html&amp;amp;title=Populating%20an%20Intermedate%20Fact%20Table" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/blinkbit4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to blogmemes" href="http://www.blogmemes.net/post.php?url=http://dbantics.blogspot.com/2009/06/populating-intermediate-fact-table.html&amp;amp;title=Populating%20an%20Intermedate%20Fact%20Table" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/blogmemes4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to buddymark" href="http://buddymarks.com/s_add_bookmark.php?bookmark_url=http://dbantics.blogspot.com/2009/06/populating-intermediate-fact-table.html&amp;amp;bookmark_title=Populating%20an%20Intermedate%20Fact%20Table" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/buddymar4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to complore" href="http://complore.com/?q=node/add/flexinode-5&amp;amp;url=http://dbantics.blogspot.com/2009/06/populating-intermediate-fact-table.html&amp;amp;title=Populating%20an%20Intermedate%20Fact%20Table" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/complore4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to del.icio.us" href="http://del.icio.us/post?url=http://dbantics.blogspot.com/2009/06/populating-intermediate-fact-table.html&amp;amp;;title=Populating%20an%20Intermedate%20Fact%20Table" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/deliciou4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to del.iri.ous!" href="http://de.lirio.us/bookmarks/sbmtool?action=add&amp;amp;address=http://dbantics.blogspot.com/2009/06/populating-intermediate-fact-table.html&amp;amp;title=Populating%20an%20Intermedate%20Fact%20Table" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/deliriou4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to digg" href="http://digg.com/submit?phase=2&amp;amp;url=http://dbantics.blogspot.com/2009/06/populating-intermediate-fact-table.html&amp;amp;title=Populating%20an%20Intermedate%20Fact%20Table" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/digg14.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to dotnetkicks" href="http://www.dotnetkicks.com/kick/?url=http://dbantics.blogspot.com/2009/06/populating-intermediate-fact-table.html&amp;amp;title=Populating%20an%20Intermedate%20Fact%20Table" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/CropperCapture154.jpg" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to Facebook" href="http://www.facebook.com/sharer.php?u=http://dbantics.blogspot.com/2009/06/populating-intermediate-fact-table.html&amp;amp;t=Populating%20an%20Intermedate%20Fact%20Table" target="_blank"&gt;&lt;img border="0" src="http://blogs.technet.com/photos/james/images/1765319/original.aspx" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to furl" href="http://www.furl.net/store?s=f&amp;amp;to=0&amp;amp;u=http://dbantics.blogspot.com/2009/06/populating-intermediate-fact-table.html&amp;amp;ti=Populating%20an%20Intermedate%20Fact%20Table" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/furl4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to live" href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;amp;mkt=en-us&amp;amp;url=http://dbantics.blogspot.com/2009/06/populating-intermediate-fact-table.html&amp;amp;title=Populating%20an%20Intermedate%20Fact%20Table" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/live4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to magnolia!" href="http://ma.gnolia.com/bookmarklet/add?url=http://dbantics.blogspot.com/2009/06/populating-intermediate-fact-table.html&amp;amp;title=Populating%20an%20Intermedate%20Fact%20Table" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/magnolia4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to netvouz!" href="http://netvouz.com/action/submitBookmark?url=http://dbantics.blogspot.com/2009/06/populating-intermediate-fact-table.html&amp;amp;title=Populating%20an%20Intermedate%20Fact%20Table" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/netvouz4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to reddit!" href="http://reddit.com/submit?url=http://dbantics.blogspot.com/2009/06/populating-intermediate-fact-table.html&amp;amp;title=Populating%20an%20Intermedate%20Fact%20Table" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/reddit4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to shadow" href="http://www.shadows.com/bookmark/saveLink.rails?page=http://dbantics.blogspot.com/2009/06/populating-intermediate-fact-table.html&amp;amp;title=Populating%20an%20Intermedate%20Fact%20Table" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/shadows6.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to spurl" href="http://www.spurl.net/spurl.php?v=3&amp;amp;url=http://dbantics.blogspot.com/2009/06/populating-intermediate-fact-table.html&amp;amp;title=Populating%20an%20Intermedate%20Fact%20Table" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/spurl8.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to technorati!" href="http://technorati.com/faves/?add=http://dbantics.blogspot.com/2009/06/populating-intermediate-fact-table.html&amp;amp;title=Populating%20an%20Intermedate%20Fact%20Table" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/technora4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to wists" href="http://www.wists.com/?action=add&amp;amp;url=http://dbantics.blogspot.com/2009/06/populating-intermediate-fact-table.html&amp;amp;title=Populating%20an%20Intermedate%20Fact%20Table" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/wists9.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to yahoo!" href="http://myweb.yahoo.com/myresults/bookmarklet?u=http://dbantics.blogspot.com/2009/06/populating-intermediate-fact-table.html&amp;amp;t=Populating%20an%20Intermedate%20Fact%20Table" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/yahoo9.png" /&gt;&lt;/a&gt;&lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36623110-1689095487090519216?l=dbantics.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://dbantics.blogspot.com/feeds/1689095487090519216/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dbantics.blogspot.com/2009/06/populating-intermediate-fact-table.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/36623110/posts/default/1689095487090519216?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/36623110/posts/default/1689095487090519216?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DBAntics/~3/KWmblJ4MIcU/populating-intermediate-fact-table.html" title="Populating an Intermediate Fact Table" /><author><name>Gogula G. Aryalingam</name><uri>http://www.blogger.com/profile/17902540052308703629</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="00699112592523224881" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://dbantics.blogspot.com/2009/06/populating-intermediate-fact-table.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEUER3g5cSp7ImA9WxJXFk4.&quot;"><id>tag:blogger.com,1999:blog-36623110.post-4024199744985369929</id><published>2009-06-05T13:02:00.001+05:30</published><updated>2009-06-10T17:46:46.629+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-10T17:46:46.629+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Excel" /><category scheme="http://www.blogger.com/atom/ns#" term="Array Formula" /><title>What on earth is an Array Formula?</title><content type="html">&lt;p align="justify"&gt;This has nothing to do with SQL Server, save a teeny weeny part. Me gets this requirement from above: Do this report thingy with Excel using macros. It shall be a temporary solution. And it shall be parallel to the permanent reporting solution that you are already developing, but with a higher priority (That’s like building a super saloon car while also building a rickety lorry with a high priority to do somewhat the same thing as the car, ‘cept that the rickety lorry should be shipped first. – That’s how one colleague put it). Ye shall extract the data from Good ole SQL Server to the Excel workbook, and Mr. Senior &lt;a href="http://www.thousandtyone.com/blog/BuildersStoryTellersAndWhinersPart1.aspx"&gt;Whiner&lt;/a&gt; shall do the macros in such a way that it'll create some nice looking reports on more Excel sheets. Anyways, with a lot of whining and I-dunnos and I-cannots the macro ball was passed by Mr. Senior Whiner to scape-goat &lt;a href="http://www.thousandtyone.com/blog/BuildersStoryTellersAndWhinersPart1.aspx"&gt;builder&lt;/a&gt;. R n' Ds by meself and scape-goat builder led to the discovery of array formulae. &lt;/p&gt;  &lt;p align="justify"&gt;I have been working with Excel for a long time, not on an extensive scale though, but quite a power user. Therefore, array formulae just came out as a big surprise. I never knew something like that ever existed. &lt;/p&gt;  &lt;p align="justify"&gt;So what's an Array Formula, you ask? &lt;/p&gt;  &lt;p align="justify"&gt;It's a formula which can be used in place multiple ‘normal’ formulae. And it works on arrays of values. And in order to enter the formula, you need to first type it in and then press &lt;strong&gt;Ctrl + Shift + Enter&lt;/strong&gt; on the keyboard. Otherwise you'll end up with the &lt;em&gt;#VALUE!&lt;/em&gt; error. Once you enter the formula successfully, you will notice that the whole formula is contained within a pair of curly braces which disappear when you click on the formula bar. &lt;/p&gt;  &lt;p align="justify"&gt;&lt;a href="http://lh4.ggpht.com/_ekbL4Mfw8E0/SijKGIozySI/AAAAAAAAALQ/RTSUmX_b_ww/s1600-h/ArrayFormula%5B4%5D.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ArrayFormula" border="0" alt="ArrayFormula" src="http://lh5.ggpht.com/_ekbL4Mfw8E0/SijKHA7s1BI/AAAAAAAAALU/e1eHNKryqjI/ArrayFormula_thumb%5B2%5D.jpg?imgmax=800" width="410" height="429" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p align="justify"&gt;In the screenshot you could see that in order to get the total value for each region I use an array formula as follows: &lt;/p&gt;  &lt;p align="justify"&gt;&lt;font face="Courier New"&gt;=SUM((C2:C17)*(D2:D17)*(A2:A17=&amp;quot;East&amp;quot;))&lt;/font&gt; &lt;/p&gt;  &lt;p align="justify"&gt;This is just a simple example. There's a whole dimension of complex formulae that can be written in a simpler and powerful form using array formulae. Just google 'Excel Array Formula', or perhaps you could even &lt;a href="http://www.bing.com/"&gt;bing&lt;/a&gt; it (if you dare)&lt;/p&gt; &lt;span class="sbmLink"&gt;   &lt;table cellspacing="1" cellpadding="1"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td class="sbmText"&gt;Share this post : &lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to Social!" href="http://social.microsoft.com/en-us/action/create/s/E/?url=http://dbantics.blogspot.com/2009/06/what-on-earth-is-array-formula.html&amp;amp;ttl=What on Earth is an Array Formula" target="_blank"&gt;&lt;img border="0" src="http://www.dotnetscraps.com/dotnetscraps/samples/sbmtool/social.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to MSDN!" href="http://social.msdn.microsoft.com/en-us/action/create/s/E/?url=http://dbantics.blogspot.com/2009/06/what-on-earth-is-array-formula.html&amp;amp;ttl=What on Earth is an Array Formula" target="_blank"&gt;&lt;img border="0" src="http://www.dotnetscraps.com/dotnetscraps/samples/sbmtool/msdn.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to Technet!" href="http://social.technet.microsoft.com/en-us/action/create/s/E/?url=http://dbantics.blogspot.com/2009/06/what-on-earth-is-array-formula.html&amp;amp;ttl=What on Earth is an Array Formula" target="_blank"&gt;&lt;img border="0" src="http://www.dotnetscraps.com/dotnetscraps/samples/sbmtool/technet.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to Expression!" href="http://social.expression.microsoft.com/en-us/action/create/s/E/?url=http://dbantics.blogspot.com/2009/06/what-on-earth-is-array-formula.html&amp;amp;ttl=What on Earth is an Array Formula" target="_blank"&gt;&lt;img border="0" src="http://www.dotnetscraps.com/dotnetscraps/samples/sbmtool/expression.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to backflip" href="http://www.backflip.com/add_page_pop.ihtml?url=http://dbantics.blogspot.com/2009/06/what-on-earth-is-array-formula.html&amp;amp;title=What on Earth is an Array Formula" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/backflip4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to blinkbits!" href="http://www.blinkbits.com/bookmarklets/save.php?v=1&amp;amp;source_url=http://dbantics.blogspot.com/2009/06/what-on-earth-is-array-formula.html&amp;amp;title=What on Earth is an Array Formula" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/blinkbit4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to blogmemes" href="http://www.blogmemes.net/post.php?url=http://dbantics.blogspot.com/2009/06/what-on-earth-is-array-formula.html&amp;amp;title=What on Earth is an Array Formula" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/blogmemes4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to buddymark" href="http://buddymarks.com/s_add_bookmark.php?bookmark_url=http://dbantics.blogspot.com/2009/06/what-on-earth-is-array-formula.html&amp;amp;bookmark_title=What on Earth is an Array Formula" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/buddymar4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to complore" href="http://complore.com?q=node/add/flexinode-5&amp;amp;url=http://dbantics.blogspot.com/2009/06/what-on-earth-is-array-formula.html&amp;amp;title=What on Earth is an Array Formula" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/complore4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to del.icio.us" href="http://del.icio.us/post?url=http://dbantics.blogspot.com/2009/06/what-on-earth-is-array-formula.html&amp;amp;;title=What on Earth is an Array Formula" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/deliciou4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to del.iri.ous!" href="http://de.lirio.us/bookmarks/sbmtool?action=add&amp;amp;address=http://dbantics.blogspot.com/2009/06/what-on-earth-is-array-formula.html&amp;amp;title=What on Earth is an Array Formula" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/deliriou4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to digg" href="http://digg.com/submit?phase=2&amp;amp;url=http://dbantics.blogspot.com/2009/06/what-on-earth-is-array-formula.html&amp;amp;title=What on Earth is an Array Formula" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/digg14.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to dotnetkicks" href="http://www.dotnetkicks.com/kick/?url=http://dbantics.blogspot.com/2009/06/what-on-earth-is-array-formula.html&amp;amp;title=What on Earth is an Array Formula" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/CropperCapture154.jpg" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to Facebook" href="http://www.facebook.com/sharer.php?u=http://dbantics.blogspot.com/2009/06/what-on-earth-is-array-formula.html&amp;amp;t=What on Earth is an Array Formula" target="_blank"&gt;&lt;img border="0" src="http://blogs.technet.com/photos/james/images/1765319/original.aspx" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to furl" href="http://www.furl.net/store?s=f&amp;amp;to=0&amp;amp;u=http://dbantics.blogspot.com/2009/06/what-on-earth-is-array-formula.html&amp;amp;ti=What on Earth is an Array Formula" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/furl4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to live" href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;amp;mkt=en-us&amp;amp;url=http://dbantics.blogspot.com/2009/06/what-on-earth-is-array-formula.html&amp;amp;title=What on Earth is an Array Formula" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/live4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to magnolia!" href="http://ma.gnolia.com/bookmarklet/add?url=http://dbantics.blogspot.com/2009/06/what-on-earth-is-array-formula.html&amp;amp;title=What on Earth is an Array Formula" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/magnolia4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to netvouz!" href="http://netvouz.com/action/submitBookmark?url=http://dbantics.blogspot.com/2009/06/what-on-earth-is-array-formula.html&amp;amp;title=What on Earth is an Array Formula" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/netvouz4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to reddit!" href="http://reddit.com/submit?url=http://dbantics.blogspot.com/2009/06/what-on-earth-is-array-formula.html&amp;amp;title=What on Earth is an Array Formula" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/reddit4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to shadow" href="http://www.shadows.com/bookmark/saveLink.rails?page=http://dbantics.blogspot.com/2009/06/what-on-earth-is-array-formula.html&amp;amp;title=What on Earth is an Array Formula" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/shadows6.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to spurl" href="http://www.spurl.net/spurl.php?v=3&amp;amp;url=http://dbantics.blogspot.com/2009/06/what-on-earth-is-array-formula.html&amp;amp;title=What on Earth is an Array Formula" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/spurl8.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to technorati!" href="http://technorati.com/faves/?add=http://dbantics.blogspot.com/2009/06/what-on-earth-is-array-formula.html&amp;amp;title=What on Earth is an Array Formula" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/technora4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to wists" href="http://www.wists.com/?action=add&amp;amp;url=http://dbantics.blogspot.com/2009/06/what-on-earth-is-array-formula.html&amp;amp;title=What on Earth is an Array Formula" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/wists9.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to yahoo!" href="http://myweb.yahoo.com/myresults/bookmarklet?u=http://dbantics.blogspot.com/2009/06/what-on-earth-is-array-formula.html&amp;amp;t=What on Earth is an Array Formula" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/yahoo9.png" /&gt;&lt;/a&gt;&lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/span&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36623110-4024199744985369929?l=dbantics.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://dbantics.blogspot.com/feeds/4024199744985369929/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dbantics.blogspot.com/2009/06/what-on-earth-is-array-formula.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/36623110/posts/default/4024199744985369929?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/36623110/posts/default/4024199744985369929?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DBAntics/~3/pWdLNW56l5E/what-on-earth-is-array-formula.html" title="What on earth is an Array Formula?" /><author><name>Gogula G. Aryalingam</name><uri>http://www.blogger.com/profile/17902540052308703629</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="00699112592523224881" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://dbantics.blogspot.com/2009/06/what-on-earth-is-array-formula.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkQEQ307cCp7ImA9WxJXFk4.&quot;"><id>tag:blogger.com,1999:blog-36623110.post-5059147029399295349</id><published>2009-05-27T17:41:00.002+05:30</published><updated>2009-06-10T18:21:42.308+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-10T18:21:42.308+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Schema Comparison" /><category scheme="http://www.blogger.com/atom/ns#" term="Datadude" /><category scheme="http://www.blogger.com/atom/ns#" term="Visual Studio Team System 2008 Database Edition" /><title>Minor Irritation in Datadude 2008</title><content type="html">&lt;p align="justify"&gt;There occurs an irritating situation in Datadude 2008 (I hear that it is from GDR1 onwards) during &lt;em&gt;Schema Comparison&lt;/em&gt;. I am not sure about Datadude 2005 though. It happens when the source is a project and the target is a database, and you try to write updates to the target. What happens is: nothing happens! The schema comparison screen continues to look exactly as it looked like; showing the differences and what action has to be performed, which is indeed irritating, until of course you open the &lt;em&gt;Error List&lt;/em&gt; window. &lt;/p&gt;  &lt;p align="justify"&gt;What happens when you click on the &lt;em&gt;Write Updates&lt;/em&gt; button is that; &lt;em&gt;if there is some change which cannot be applied to the database destination such as an action which would add a non-null column without a default to a table with data&lt;/em&gt;, or &lt;em&gt;if there is simply a syntax error in the source project such as &lt;span style="font-family: courier new"&gt;ADD [NewColumn] varchar10&lt;/span&gt;&lt;/em&gt;; changes are not applied to the target database. The thing is, the &lt;em&gt;Error List&lt;/em&gt; gets updated alright, but it does not pop-up, even when it is hidden. This just gives us the “illusion” that nothing happens. Also, in case there is a syntax error such as in the latter scenario; the &lt;em&gt;Export to Editor&lt;/em&gt; button gets grayed out. &lt;/p&gt;  &lt;p align="justify"&gt;&lt;a href="http://lh4.ggpht.com/_ekbL4Mfw8E0/Sh6ueGrF-CI/AAAAAAAAALI/zioDffur0KA/s1600-h/Datadude%202008%20Schema%20Comparison%20Issue%5B3%5D.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Datadude 2008 Schema Comparison Issue" border="0" alt="Datadude 2008 Schema Comparison Issue" src="http://lh4.ggpht.com/_ekbL4Mfw8E0/Sh6ufCsVmMI/AAAAAAAAALM/abTmaCvUoB0/Datadude%202008%20Schema%20Comparison%20Issue_thumb%5B1%5D.jpg?imgmax=800" width="549" height="389" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p align="justify"&gt;This may be a minor issue, but it sure irritates when you didn't know it before hand. Solution: whenever you experience that updates are not written to the target database or if the &lt;em&gt;Export to Editor&lt;/em&gt; button is grayed out, all you have to do is open the &lt;em&gt;Error List&lt;/em&gt;...&lt;/p&gt; &lt;span class="sbmLink"&gt;   &lt;table cellspacing="1" cellpadding="1"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td class="sbmText"&gt;Share this post : &lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to Social!" href="http://social.microsoft.com/en-us/action/create/s/E/?url=http://dbantics.blogspot.com/2009/05/minor-irritation-in-datadude-2008.html&amp;amp;ttl=Minor Irritation in Datadude 2008" target="_blank"&gt;&lt;img border="0" src="http://www.dotnetscraps.com/dotnetscraps/samples/sbmtool/social.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to MSDN!" href="http://social.msdn.microsoft.com/en-us/action/create/s/E/?url=http://dbantics.blogspot.com/2009/05/minor-irritation-in-datadude-2008.html&amp;amp;ttl=Minor Irritation in Datadude 2008" target="_blank"&gt;&lt;img border="0" src="http://www.dotnetscraps.com/dotnetscraps/samples/sbmtool/msdn.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to Technet!" href="http://social.technet.microsoft.com/en-us/action/create/s/E/?url=http://dbantics.blogspot.com/2009/05/minor-irritation-in-datadude-2008.html&amp;amp;ttl=Minor Irritation in Datadude 2008" target="_blank"&gt;&lt;img border="0" src="http://www.dotnetscraps.com/dotnetscraps/samples/sbmtool/technet.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to Expression!" href="http://social.expression.microsoft.com/en-us/action/create/s/E/?url=http://dbantics.blogspot.com/2009/05/minor-irritation-in-datadude-2008.html&amp;amp;ttl=Minor Irritation in Datadude 2008" target="_blank"&gt;&lt;img border="0" src="http://www.dotnetscraps.com/dotnetscraps/samples/sbmtool/expression.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to backflip" href="http://www.backflip.com/add_page_pop.ihtml?url=http://dbantics.blogspot.com/2009/05/minor-irritation-in-datadude-2008.html&amp;amp;title=Minor Irritation in Datadude 2008" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/backflip4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to blinkbits!" href="http://www.blinkbits.com/bookmarklets/save.php?v=1&amp;amp;source_url=http://dbantics.blogspot.com/2009/05/minor-irritation-in-datadude-2008.html&amp;amp;title=Minor Irritation in Datadude 2008" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/blinkbit4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to blogmemes" href="http://www.blogmemes.net/post.php?url=http://dbantics.blogspot.com/2009/05/minor-irritation-in-datadude-2008.html&amp;amp;title=Minor Irritation in Datadude 2008" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/blogmemes4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to buddymark" href="http://buddymarks.com/s_add_bookmark.php?bookmark_url=http://dbantics.blogspot.com/2009/05/minor-irritation-in-datadude-2008.html&amp;amp;bookmark_title=Minor Irritation in Datadude 2008" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/buddymar4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to complore" href="http://complore.com?q=node/add/flexinode-5&amp;amp;url=http://dbantics.blogspot.com/2009/05/minor-irritation-in-datadude-2008.html&amp;amp;title=Minor Irritation in Datadude 2008" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/complore4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to del.icio.us" href="http://del.icio.us/post?url=http://dbantics.blogspot.com/2009/05/minor-irritation-in-datadude-2008.html&amp;amp;;title=Minor Irritation in Datadude 2008" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/deliciou4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to del.iri.ous!" href="http://de.lirio.us/bookmarks/sbmtool?action=add&amp;amp;address=http://dbantics.blogspot.com/2009/05/minor-irritation-in-datadude-2008.html&amp;amp;title=Minor Irritation in Datadude 2008" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/deliriou4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to digg" href="http://digg.com/submit?phase=2&amp;amp;url=http://dbantics.blogspot.com/2009/05/minor-irritation-in-datadude-2008.html&amp;amp;title=Minor Irritation in Datadude 2008" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/digg14.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to dotnetkicks" href="http://www.dotnetkicks.com/kick/?url=http://dbantics.blogspot.com/2009/05/minor-irritation-in-datadude-2008.html&amp;amp;title=Minor Irritation in Datadude 2008" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/CropperCapture154.jpg" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to Facebook" href="http://www.facebook.com/sharer.php?u=http://dbantics.blogspot.com/2009/05/minor-irritation-in-datadude-2008.html&amp;amp;t=Minor Irritation in Datadude 2008" target="_blank"&gt;&lt;img border="0" src="http://blogs.technet.com/photos/james/images/1765319/original.aspx" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to furl" href="http://www.furl.net/store?s=f&amp;amp;to=0&amp;amp;u=http://dbantics.blogspot.com/2009/05/minor-irritation-in-datadude-2008.html&amp;amp;ti=Minor Irritation in Datadude 2008" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/furl4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to live" href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;amp;mkt=en-us&amp;amp;url=http://dbantics.blogspot.com/2009/05/minor-irritation-in-datadude-2008.html&amp;amp;title=Minor Irritation in Datadude 2008" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/live4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to magnolia!" href="http://ma.gnolia.com/bookmarklet/add?url=http://dbantics.blogspot.com/2009/05/minor-irritation-in-datadude-2008.html&amp;amp;title=Minor Irritation in Datadude 2008" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/magnolia4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to netvouz!" href="http://netvouz.com/action/submitBookmark?url=http://dbantics.blogspot.com/2009/05/minor-irritation-in-datadude-2008.html&amp;amp;title=Minor Irritation in Datadude 2008" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/netvouz4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to reddit!" href="http://reddit.com/submit?url=http://dbantics.blogspot.com/2009/05/minor-irritation-in-datadude-2008.html&amp;amp;title=Minor Irritation in Datadude 2008" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/reddit4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to shadow" href="http://www.shadows.com/bookmark/saveLink.rails?page=http://dbantics.blogspot.com/2009/05/minor-irritation-in-datadude-2008.html&amp;amp;title=Minor Irritation in Datadude 2008" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/shadows6.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to spurl" href="http://www.spurl.net/spurl.php?v=3&amp;amp;url=http://dbantics.blogspot.com/2009/05/minor-irritation-in-datadude-2008.html&amp;amp;title=Minor Irritation in Datadude 2008" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/spurl8.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to technorati!" href="http://technorati.com/faves/?add=http://dbantics.blogspot.com/2009/05/minor-irritation-in-datadude-2008.html&amp;amp;title=Minor Irritation in Datadude 2008" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/technora4.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to wists" href="http://www.wists.com/?action=add&amp;amp;url=http://dbantics.blogspot.com/2009/05/minor-irritation-in-datadude-2008.html&amp;amp;title=Minor Irritation in Datadude 2008" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/wists9.png" /&gt;&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;&lt;a title="Post it to yahoo!" href="http://myweb.yahoo.com/myresults/bookmarklet?u=http://dbantics.blogspot.com/2009/05/minor-irritation-in-datadude-2008.html&amp;amp;t=Minor Irritation in Datadude 2008" target="_blank"&gt;&lt;img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/yahoo9.png" /&gt;&lt;/a&gt;&lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/span&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36623110-5059147029399295349?l=dbantics.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://dbantics.blogspot.com/feeds/5059147029399295349/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dbantics.blogspot.com/2009/05/minor-irritation-in-datadude-2008.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/36623110/posts/default/5059147029399295349?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/36623110/posts/default/5059147029399295349?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DBAntics/~3/hXT2dxPj0h8/minor-irritation-in-datadude-2008.html" title="Minor Irritation in Datadude 2008" /><author><name>Gogula G. Aryalingam</name><uri>http://www.blogger.com/profile/17902540052308703629</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="00699112592523224881" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://dbantics.blogspot.com/2009/05/minor-irritation-in-datadude-2008.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkYERHo9eip7ImA9WxJQEks.&quot;"><id>tag:blogger.com,1999:blog-36623110.post-1999044287229423614</id><published>2009-05-25T19:25:00.002+05:30</published><updated>2009-05-25T19:31:45.462+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-05-25T19:31:45.462+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="T-SQL" /><category scheme="http://www.blogger.com/atom/ns#" term="SQLCMD" /><title>SQLCMD and its usage in the Management Studio Query Editor</title><content type="html">&lt;p align="justify"&gt;I have been getting used to using Datadude (a.k.a. Visual Studio Team System 2008 Database Edition) in the recent days (I jumped directly onto the Datadude 2008 bandwagon).&lt;/p&gt;  &lt;p align="justify"&gt;Coming to the topic… When generating schema scripts, let's say to create a new database or alter an existing one, datadude uses some SQLCMD codes. It uses these, for example to set the database name in a parameterized fashion. Like this: &lt;/p&gt;  &lt;p&gt;&lt;span style="font-family:Courier New;"&gt;:setvar DatabaseName "MyDatabase"    &lt;br /&gt;:setvar DefaultDataPath "D:\Databases\" &lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-family:Courier New;"&gt;CREATE DATABASE [$(DatabaseName)]    &lt;br /&gt;ON     &lt;br /&gt;(     &lt;br /&gt;    NAME = [$(DatabaseName)],     &lt;br /&gt;    FILENAME = '$(DefaultDataPath)My_Database.mdf',     &lt;br /&gt;    SIZE = 51200 KB,     &lt;br /&gt;    MAXSIZE = UNLIMITED,     &lt;br /&gt;    FILEGROWTH = 10240 KB     &lt;br /&gt;)     &lt;br /&gt;LOG ON     &lt;br /&gt;(     &lt;br /&gt;    NAME = [$(DatabaseName)_log],     &lt;br /&gt;    FILENAME = '$(DefaultDataPath)My_Database.ldf',     &lt;br /&gt;    SIZE = 102400 KB,     &lt;br /&gt;    MAXSIZE = 2097152 MB,     &lt;br /&gt;    FILEGROWTH = 1024 KB     &lt;br /&gt;)&lt;/span&gt;&lt;/p&gt;  &lt;p align="justify"&gt;When you need to parameterize stuff such as database file paths or database names in your create database script or something you may be in for a fix when using the usual T-SQL parameters, and may need to write a little more complex T-SQL for the task, such as dynamic SQL which I feel is somewhat unnatural. Using SQLCMD, therefore makes it quite simple and clean. What hurts me though, is that SQLCMD has been around since SQL Server 2005, and I have only just adopted it.&lt;/p&gt;  &lt;p align="justify"&gt;When using SQLCMD in the Query Editor of Management Studio, it would not work under the default settings. You would as a result need to enable SQLCMD mode from the Query menu. &lt;/p&gt;  &lt;p align="justify"&gt;&lt;a href="http://lh4.ggpht.com/_ekbL4Mfw8E0/ShqjS6XGwOI/AAAAAAAAALA/4z7cAmOwaZg/s1600-h/Enable%20SQLCMD%20in%20Query%20Editor%5B5%5D.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Enable SQLCMD in Query Editor" border="0" alt="Enable SQLCMD in Query Editor" src="http://lh6.ggpht.com/_ekbL4Mfw8E0/ShqjWhnxSCI/AAAAAAAAALE/BUwnCkWeCRY/Enable%20SQLCMD%20in%20Query%20Editor_thumb%5B3%5D.jpg?imgmax=800" width="607" height="359" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p align="justify"&gt;The primary usage of SQLCMD though, is for command prompt based queries. Yet, it also comes in quite handy in times like these mentioned earlier.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36623110-1999044287229423614?l=dbantics.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://dbantics.blogspot.com/feeds/1999044287229423614/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dbantics.blogspot.com/2009/05/sqlcmd-and-its-usage-in-management.html#comment-form" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/36623110/posts/default/1999044287229423614?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/36623110/posts/default/1999044287229423614?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DBAntics/~3/vWYfOeHFdAc/sqlcmd-and-its-usage-in-management.html" title="SQLCMD and its usage in the Management Studio Query Editor" /><author><name>Gogula G. Aryalingam</name><uri>http://www.blogger.com/profile/17902540052308703629</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="00699112592523224881" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">3</thr:total><feedburner:origLink>http://dbantics.blogspot.com/2009/05/sqlcmd-and-its-usage-in-management.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0cMQHY7fip7ImA9WxJREk0.&quot;"><id>tag:blogger.com,1999:blog-36623110.post-7496027060569559541</id><published>2009-05-13T15:32:00.002+05:30</published><updated>2009-05-13T15:34:41.806+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-05-13T15:34:41.806+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server 2008" /><category scheme="http://www.blogger.com/atom/ns#" term="Enterprise Edition" /><category scheme="http://www.blogger.com/atom/ns#" term="Restore" /><category scheme="http://www.blogger.com/atom/ns#" term="Backup" /><title>Restoring a database to a lower edition – SQL Server 2008</title><content type="html">&lt;p&gt;SQL Server 2008 introduced a few Enterprise Edition-only features which changes the structure of a database when implemented. These features are:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Partitioning &lt;/li&gt;&lt;li&gt;Change data capture &lt;/li&gt;&lt;li&gt;Transparent data encryption &lt;/li&gt;&lt;li&gt;Data compression &lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Due to this, whenever you do a database restore or attach on an SQL Server 2008 instance with a lower edition, SQL Server would not allow you.&lt;/p&gt;&lt;p&gt;So what can you do when you have to move a database to a lower edition? Remove the offending features of course, there's nothing else that you could do. But, how would you know which of the offending enterprise edition-only features are enabled on your database? Use the new dynamic management view &lt;em&gt;&lt;span style="color:#008000;"&gt;sys.dm_db_persisted_sku_features&lt;/span&gt;&lt;/em&gt;. It's a simple view which returns the feature you have enabled on your database along with its id. Hence, if the view shows any records, all you got to do now is disable the feature(s) before backing up.&lt;/p&gt;&lt;p&gt; &lt;a href="http://lh5.ggpht.com/_ekbL4Mfw8E0/Sgqaw2S7qtI/AAAAAAAAAKw/7xYmEoSFFO0/s1600-h/Query%5B4%5D.jpg"&gt;&lt;img style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title="Query" border="0" alt="Query" src="http://lh3.ggpht.com/_ekbL4Mfw8E0/SgqaxmYO7rI/AAAAAAAAAK0/WtUxER-JNJM/Query_thumb%5B2%5D.jpg?imgmax=800" width="361" height="99" /&gt;&lt;/a&gt; &lt;a href="http://lh5.ggpht.com/_ekbL4Mfw8E0/SgqayR0xCNI/AAAAAAAAAK4/Ur9jnOD2nvk/s1600-h/Results%5B2%5D.jpg"&gt;&lt;img style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title="Results" border="0" alt="Results" src="http://lh4.ggpht.com/_ekbL4Mfw8E0/SgqazbIc8-I/AAAAAAAAAK8/xJQCwLm6kVY/Results_thumb.jpg?imgmax=800" width="191" height="92" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;&lt;em&gt;Note: Of course partitioning was present in SQL Server 2005 as well, and even there you had to remove partitioning if you had to restore a database on a lower edition.&lt;/em&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36623110-7496027060569559541?l=dbantics.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://dbantics.blogspot.com/feeds/7496027060569559541/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dbantics.blogspot.com/2009/05/restoring-database-to-lower-edition-sql.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/36623110/posts/default/7496027060569559541?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/36623110/posts/default/7496027060569559541?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DBAntics/~3/_V9_aLbCWBw/restoring-database-to-lower-edition-sql.html" title="Restoring a database to a lower edition – SQL Server 2008" /><author><name>Gogula G. Aryalingam</name><uri>http://www.blogger.com/profile/17902540052308703629</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="00699112592523224881" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://dbantics.blogspot.com/2009/05/restoring-database-to-lower-edition-sql.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkIBQXs6fCp7ImA9WxVaE0k.&quot;"><id>tag:blogger.com,1999:blog-36623110.post-4954633414220737827</id><published>2009-04-09T12:51:00.012+05:30</published><updated>2009-04-10T11:52:30.514+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-04-10T11:52:30.514+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server 2008" /><category scheme="http://www.blogger.com/atom/ns#" term="Service Pack" /><category scheme="http://www.blogger.com/atom/ns#" term="Slipstream" /><category scheme="http://www.blogger.com/atom/ns#" term="SP1" /><category scheme="http://www.blogger.com/atom/ns#" term="Service Pack 1" /><title>Slipstreaming SQL Server 2008 SP1</title><content type="html">&lt;div style="text-align: justify"&gt;Service pack 1 for SQL Server 2008 was released just a couple of days ago (07-Apr-09), eight months after the RTM. As exciting as it is, I did not want to put up just an 'SP1 Released' post, since it may seem a little too ambiguous and also since I had already done it on the '&lt;i&gt;&lt;a href="http://sqlserveruniverse.com/forums/thread/868.aspx"&gt;Universe&lt;/a&gt;&lt;/i&gt;'...&lt;/div&gt;  &lt;div style="text-align: justify"&gt;   &lt;br /&gt;&lt;/div&gt;  &lt;div style="text-align: justify"&gt;One feature of this service pack is that it allows for administrators to slipstream it into the main product, hence when new SQL Server 2008 installations are required, they could just install it along with SP1 in one go. This obviously saves time and money. Put that together with the fact that many people haven't gone ahead with SQL Server 2008 yet; you'll have a lot of happy administrators when their organizations finally decide to go ahead with implementing SQL Server 2008.&lt;/div&gt;  &lt;div style="text-align: justify"&gt;I just tried creating my own slipstreamed &lt;i&gt;SQL Server 2008 with SP1&lt;/i&gt; drop (&lt;a href="http://blogs.msdn.com/petersad/archive/2009/02/25/sql-server-2008-creating-a-merged-slisptream-drop.aspx"&gt;following these steps&lt;/a&gt;), coupling in the latest version of &lt;i&gt;Books Online&lt;/i&gt; as well. The only issue was that the final size of the entire folder was more than 5GB, which requires me to compress it if I need to burn it onto a DVD. &lt;i&gt;Isn’t it nice, when things just (almost) work...?&lt;/i&gt;&lt;/div&gt;  &lt;div style="text-align: justify"&gt;&lt;i&gt;     &lt;br /&gt;&lt;/i&gt;&lt;/div&gt;  &lt;div style="text-align: justify"&gt;&lt;i&gt;&lt;img style="width: 417px; height: 379px; cursor: hand" id="BLOGGER_PHOTO_ID_5322873082079332722" border="0" alt="" src="http://1.bp.blogspot.com/_ekbL4Mfw8E0/Sd6k3cnTyXI/AAAAAAAAAKY/Eggn2G1QUEM/s320/SQLServer2008_Slipstream_Setup.jpg" width="425" height="386" /&gt;&lt;/i&gt;&lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36623110-4954633414220737827?l=dbantics.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://dbantics.blogspot.com/feeds/4954633414220737827/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dbantics.blogspot.com/2009/04/slipstreaming-sql-server-2008-sp1.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/36623110/posts/default/4954633414220737827?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/36623110/posts/default/4954633414220737827?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DBAntics/~3/YHHRD2bG8ok/slipstreaming-sql-server-2008-sp1.html" title="Slipstreaming SQL Server 2008 SP1" /><author><name>Gogula G. Aryalingam</name><uri>http://www.blogger.com/profile/17902540052308703629</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="00699112592523224881" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_ekbL4Mfw8E0/Sd6k3cnTyXI/AAAAAAAAAKY/Eggn2G1QUEM/s72-c/SQLServer2008_Slipstream_Setup.jpg" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://dbantics.blogspot.com/2009/04/slipstreaming-sql-server-2008-sp1.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkMERXo9fyp7ImA9WxJSEUk.&quot;"><id>tag:blogger.com,1999:blog-36623110.post-213136821888848423</id><published>2009-04-03T08:34:00.012+05:30</published><updated>2009-05-01T08:56:44.467+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-05-01T08:56:44.467+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Certification" /><title>To get Certified, or Not to get Certified</title><content type="html">&lt;span style="font-family: &amp;#39;Times New Roman&amp;#39;" class="Apple-style-span"&gt;   &lt;div style="text-align: justify; padding-bottom: 3px; border-right-width: 0px; margin: 0px; padding-left: 3px; width: auto; padding-right: 3px; font: 100% georgia, serif; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 3px"&gt;&lt;span style="font-size: small" class="Apple-style-span"&gt;Being technically certified is something that all of us (or at least most of us) would love to be. But, getting there is certainly a little bit more practical than wishing it were so. Surprisingly getting oneself technically certified is not a elephantine task as most of us think. It obviously requires some effort alright, but most of us (me included in the not so distant past) always like to put it away for next month. I have successfully put away my certification exams for next month, only to realize that it it had actually gone beyond an year. And not just once, but twice. And the best part of it was, that I started giving myself excuses; &lt;/span&gt;&lt;i&gt;&lt;span style="font-size: small" class="Apple-style-span"&gt;It's only been a couple of months since the last exam, I'll do it next month&lt;/span&gt;&lt;/i&gt;&lt;span style="font-size: small" class="Apple-style-span"&gt;. &lt;/span&gt;&lt;i&gt;&lt;span style="font-size: small" class="Apple-style-span"&gt;Darn! Too much work at office, I'll do it next month&lt;/span&gt;&lt;/i&gt;&lt;span style="font-size: small" class="Apple-style-span"&gt;. &lt;/span&gt;&lt;i&gt;&lt;span style="font-size: small" class="Apple-style-span"&gt;I have this and that to do this month, I'll do it next month&lt;/span&gt;&lt;/i&gt;&lt;span style="font-size: small" class="Apple-style-span"&gt;.&lt;/span&gt;&lt;/div&gt;    &lt;div style="text-align: justify; padding-bottom: 3px; border-right-width: 0px; margin: 0px; padding-left: 3px; width: auto; padding-right: 3px; font: 100% georgia, serif; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 3px"&gt;&lt;span style="font-size: small" class="Apple-style-span"&gt;The second time it happened, it really hurt. Who was I fooling? And what was I trying to prove pushing back the exams?&lt;/span&gt;&lt;/div&gt;    &lt;div style="text-align: justify; padding-bottom: 3px; border-right-width: 0px; margin: 0px; padding-left: 3px; width: auto; padding-right: 3px; font: 100% georgia, serif; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 3px"&gt;&lt;span style="font-size: small" class="Apple-style-span"&gt;See, the first time I did my certification (SQL Server 2005 MCTS) after an year of pushing back was when I got a free voucher from &lt;/span&gt;&lt;a href="http://merill.net/"&gt;&lt;span style="font-size: small" class="Apple-style-span"&gt;Merill&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: small" class="Apple-style-span"&gt;. And it was to expire in a little more than a week. And I had to use it. Use it, i did and got through. Then the pushing back came again, and it was worse this time - 19 months. Then I received a couple of free vouchers for SQL Server 2008 beta MCTSs and some random googling found me more voucher codes published by considerate people for SQL Server 2008 MCITPs, and the thing was all of these were only valid for a month. But heck, I didn't want to waste even one of them. Used them and got through: &lt;/span&gt;&lt;i&gt;&lt;span style="font-size: small" class="Apple-style-span"&gt;Certifications are no more going to be pushed back agai&lt;/span&gt;&lt;/i&gt;&lt;span style="font-size: small" class="Apple-style-span"&gt;n.&lt;/span&gt;&lt;/div&gt;    &lt;div style="text-align: justify; padding-bottom: 3px; border-right-width: 0px; margin: 0px; padding-left: 3px; width: auto; padding-right: 3px; font: 100% georgia, serif; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 3px"&gt;&lt;span style="font-size: small" class="Apple-style-span"&gt;See, there's one thing that we Sri Lankans love, and that is getting stuff free or for a discount. I could even be a little bolder and extend this statement to include Asians as well. So, if something valuable (yes 50 USDs is quite valuable to a lot of folk) comes along free or with a discount it is really worth it.&lt;/span&gt;&lt;/div&gt;    &lt;div style="text-align: justify; padding-bottom: 3px; border-right-width: 0px; margin: 0px; padding-left: 3px; width: auto; padding-right: 3px; font: 100% georgia, serif; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 3px"&gt;&lt;span style="font-size: small" class="Apple-style-span"&gt;What I am really trying to say is, guys, there are offers that keep coming up from time to time, where you could get discounts or free vouchers to do your certifications. Grab these opportunities and get it done with, and keep going. Don't set deadlines too far off. Don't give yourselves excuses for doing it next month. You never know how your certification will help you push yourself that extra bit in your career. Even if you have to pay for your certification in full, get it done with...&lt;/span&gt;&lt;/div&gt;    &lt;div style="text-align: justify; padding-bottom: 3px; border-right-width: 0px; margin: 0px; padding-left: 3px; width: auto; padding-right: 3px; font: 100% georgia, serif; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 3px"&gt;&lt;span style="font-size: small" class="Apple-style-span"&gt;       &lt;br /&gt;&lt;/span&gt;&lt;/div&gt;    &lt;div style="text-align: justify; padding-bottom: 3px; border-right-width: 0px; margin: 0px; padding-left: 3px; width: auto; padding-right: 3px; font: 100% georgia, serif; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 3px"&gt;&lt;span style="color: #660000" class="Apple-style-span"&gt;&lt;i&gt;&lt;span style="font-family: &amp;#39;courier new&amp;#39;" class="Apple-style-span"&gt;&lt;span style="font-size: small" class="Apple-style-span"&gt;&lt;strike&gt;It also happens that I have 10% discount vouchers with free second shot available until April 30, 2009. These vouchers can be used to do any MCTS, MCITP or MCPD exams before May 31, 2009. If anyone is interested mail me at gogulaa[at]gmail.com, and I shall be happy to send you your voucher. This offer is only valid for exams taken in Sri Lanka. If you are from another country, you could try contacting an MVP from there and maybe he/she will be able to help you out.&lt;/strike&gt;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;    &lt;div style="text-align: justify; padding-bottom: 3px; border-right-width: 0px; margin: 0px; padding-left: 3px; width: auto; padding-right: 3px; font: 100% georgia, serif; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 3px"&gt;&lt;span style="color: #660000" class="Apple-style-span"&gt;&lt;i&gt;&lt;span style="font-family: &amp;#39;courier new&amp;#39;" class="Apple-style-span"&gt;&lt;span style="font-size: small" class="Apple-style-span"&gt;&lt;strike&gt;Disclaimer: No, the above article is not an advertisment to lure you into requesting vouchers. :)&lt;/strike&gt;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt; &lt;/span&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36623110-213136821888848423?l=dbantics.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://dbantics.blogspot.com/feeds/213136821888848423/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dbantics.blogspot.com/2009/04/to-get-certified-or-not-to-get.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/36623110/posts/default/213136821888848423?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/36623110/posts/default/213136821888848423?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DBAntics/~3/g7rEn6cdZ3U/to-get-certified-or-not-to-get.html" title="To get Certified, or Not to get Certified" /><author><name>Gogula G. Aryalingam</name><uri>http://www.blogger.com/profile/17902540052308703629</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="00699112592523224881" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://dbantics.blogspot.com/2009/04/to-get-certified-or-not-to-get.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0UNRn86eCp7ImA9WxVaE0k.&quot;"><id>tag:blogger.com,1999:blog-36623110.post-1888894948781089707</id><published>2009-03-26T09:32:00.017+05:30</published><updated>2009-04-10T13:11:37.110+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-04-10T13:11:37.110+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Business Intelligence" /><title>The History of Business Intelligence</title><content type="html">&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;Given here is a video of a presentation done by Nic Smith, BI Solutions Manager at Microsoft. He talks about how Business Intelligence came into being, along with its failures. I think it's a really cool presentation which I believe should be viewed by anyone in BI.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;Apart from the excellent and simple narrative, it also gives a little insight on the history of pop culture mixed with subtle humor, which really kept me smiling throughout the presentation, especially the "iced out" part. Man that was funniest! The thing is; it's a very simple presentation, but you could see the effort that had gone into it, a manifestation of the quote by Spanish playwright Poncela: "When something can be read without effort, great effort has gone into its writing". Hats off to Nic. Enjoy...&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div style="text-align: justify;"&gt;&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/_1y5jBESLPE&amp;amp;color1=0xb1b1b1&amp;amp;color2=0xcfcfcf&amp;amp;hl=en&amp;amp;feature=player_embedded&amp;amp;fs=1"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;embed src="http://www.youtube.com/v/_1y5jBESLPE&amp;amp;color1=0xb1b1b1&amp;amp;color2=0xcfcfcf&amp;amp;hl=en&amp;amp;feature=player_embedded&amp;amp;fs=1" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;Please put your comments on the original post: &lt;/span&gt;&lt;a href="http://blogs.msdn.com/bi/archive/2009/03/22/history-of-business-intelligence.aspx"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;http://blogs.msdn.com/bi/archive/2009/03/22/history-of-business-intelligence.aspx&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;.&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36623110-1888894948781089707?l=dbantics.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="related" href="http://blogs.msdn.com/bi/archive/2009/03/22/history-of-business-intelligence.aspx" title="The History of Business Intelligence" /><link rel="enclosure" type="" href="http://blogs.msdn.com/bi/archive/2009/03/22/history-of-business-intelligence.aspx" length="0" /><link rel="replies" type="application/atom+xml" href="http://dbantics.blogspot.com/feeds/1888894948781089707/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dbantics.blogspot.com/2009/03/history-of-business-intelligence.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/36623110/posts/default/1888894948781089707?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/36623110/posts/default/1888894948781089707?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DBAntics/~3/6OgcgCHWUsY/history-of-business-intelligence.html" title="The History of Business Intelligence" /><author><name>Gogula G. Aryalingam</name><uri>http://www.blogger.com/profile/17902540052308703629</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="00699112592523224881" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://dbantics.blogspot.com/2009/03/history-of-business-intelligence.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUYBRXk_eSp7ImA9WxVVE0w.&quot;"><id>tag:blogger.com,1999:blog-36623110.post-4112079647283588595</id><published>2009-03-03T23:51:00.005+05:30</published><updated>2009-03-06T09:49:14.741+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-06T09:49:14.741+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="x64" /><category scheme="http://www.blogger.com/atom/ns#" term="Access" /><category scheme="http://www.blogger.com/atom/ns#" term="Excel" /><category scheme="http://www.blogger.com/atom/ns#" term="64-bit" /><category scheme="http://www.blogger.com/atom/ns#" term="Integration Services" /><title>Of Excel, Errors, SSIS and x64</title><content type="html">&lt;p align="justify"&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;Here’s something to always keep in mind when Working with Office Excel (or for that matter Office Access) in Integration Services on a 64-bit operating system: You are bound to get errors.&lt;/span&gt;&lt;/p&gt;  &lt;p align="justify"&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;This is because Office Excel and Access files are connected to, from SSIS using Jet drivers, and Jet drivers come only in 32-bit form. A lot of us have taken to using 64-bit OSes such as Vista Ultimate 64-bit or Windows Server 2008 64-bit, what with the prices of memory being so affordable and all that. But running a perfect Integration Services Package (which you had tested and run several times) copied from a 32-bit machine can cause that all-too-familiar sinking feeling in your stomach. Or even building an Integration Services package from scratch like you have always done (in a 32-bit environment) may give you an &lt;/span&gt;&lt;em&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;AcquireConnection call failure &lt;/span&gt;&lt;/em&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;(i.e. your package is unable to connect to your Excel file although everything seems alright).&lt;/span&gt;&lt;/p&gt;  &lt;p align="justify"&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;The solution to this is:&lt;/span&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;     &lt;div align="justify"&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;If you are running the package in the debug mode (i.e. from BIDS), set the &lt;/span&gt;&lt;em&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;Run64BitRuntime &lt;/span&gt;&lt;/em&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;property of the solution to &lt;/span&gt;&lt;em&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;False&lt;/span&gt;&lt;/em&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;. This property is set to &lt;/span&gt;&lt;em&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;true&lt;/span&gt;&lt;/em&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt; by default in x64 environments, hence giving you the error (which is believe me, very frustrating for a first-timer on x64).&lt;/span&gt;&lt;/div&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p align="justify"&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;     &lt;div align="justify"&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;If you are running the package directly (from the file system) through the DTExec or DTExecUI utilities you will have to make sure that you run the package using the 32-bit version of the respective utility: The 32-bit version by default can be found in the &lt;/span&gt;&lt;em&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;&amp;lt;drive&amp;gt;:\ Program Files(x86)\Microsoft SQL Server\100\DTS\Binn&lt;/span&gt;&lt;/em&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt; folder, whereas the 64-bit version can be found be default in the &lt;/span&gt;&lt;em&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;&amp;lt;drive&amp;gt;:\Program Files\Microsoft SQL Server\100\DTS\Binn&lt;/span&gt;&lt;/em&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt; folder. This, of course is for SQL Server 2008, whereas for SQL Server 2005 you would have to substitute &lt;/span&gt;&lt;em&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;100&lt;/span&gt;&lt;/em&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt; with &lt;/span&gt;&lt;em&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;90&lt;/span&gt;&lt;/em&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;.&lt;/span&gt;&lt;/div&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p align="justify"&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;So, do make a note to check your 64bit “settings”, the next time you are working with Integration Services and Excel on a 64-bit environment. You may cross paths with errors such as &lt;/span&gt;&lt;strong&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;The AcquireConnection method call to the connection manager "Excel Connection Manager" failed with error code 0xC0202009&lt;/span&gt;&lt;/strong&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt; or &lt;/span&gt;&lt;strong&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;The For Each File enumerator is empty. The For Each File enumerator did not find any files that matched the file pattern, or the specified directory was empty&lt;/span&gt;&lt;/strong&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&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/36623110-4112079647283588595?l=dbantics.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://dbantics.blogspot.com/feeds/4112079647283588595/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dbantics.blogspot.com/2009/03/of-excel-errors-ssis-and-x64.html#comment-form" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/36623110/posts/default/4112079647283588595?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/36623110/posts/default/4112079647283588595?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DBAntics/~3/0AqUxw44R9I/of-excel-errors-ssis-and-x64.html" title="Of Excel, Errors, SSIS and x64" /><author><name>Gogula G. Aryalingam</name><uri>http://www.blogger.com/profile/17902540052308703629</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="00699112592523224881" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">3</thr:total><feedburner:origLink>http://dbantics.blogspot.com/2009/03/of-excel-errors-ssis-and-x64.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0UAQX4-fip7ImA9WxVVEUk.&quot;"><id>tag:blogger.com,1999:blog-36623110.post-3479318857610225876</id><published>2009-02-26T00:40:00.022+05:30</published><updated>2009-03-04T12:17:20.056+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-04T12:17:20.056+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Not-So-Hip-Snippets-Yet-Useful-At-Times" /><category scheme="http://www.blogger.com/atom/ns#" term="Database Maintenance" /><category scheme="http://www.blogger.com/atom/ns#" term="Restore" /><category scheme="http://www.blogger.com/atom/ns#" term="Backup" /><title>Date of Latest Backup/Restore</title><content type="html">&lt;p&gt;&lt;span&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;My colleague who is a developer usually comes up with requests for little bits and pieces of database related information. This time, it was a request for the latest date that a particular database had been restored from a backup. T’was nothing but 10 minutes of BOL and coding, but lot of people out there might find it quite useful on some occasions. So here we go, the first in the series of &lt;/span&gt;&lt;em&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;Not-So-Hip-Snippets-Yet-Useful-At-Times&lt;/span&gt;&lt;/em&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;...&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;A list of database on your instance are stored in the &lt;/span&gt;&lt;span style="font-family:Courier New;color:#008000;"&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;sys.databases&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt; table in the master database, while the backup and restore information is stored in the msdb database on several tables:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span"  style=" ;font-size:85%;"&gt;For backups: dbo.backupset, dbo.backupmediaset, dbo.backupmediafamily&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span"  style=" ;font-size:85%;"&gt;For restores: dbo.restorehistory, dbo.restorefile, dbo.restorefilegroup&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;The database ID is not maintained in the listed tables, hence we would need to join the the sys.databases table with the required tables using the database names. This is the code to get a list of the latest backups performed against your databases:&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-width:2px; border-style:solid; padding:10px"&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;SELECT&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;d.[name] &lt;/span&gt;&lt;/span&gt;&lt;span class="kwrd"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;AS&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="str"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;'Database Name'&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;,&lt;br /&gt;ISNULL(&lt;/span&gt;&lt;/span&gt;&lt;span class="kwrd"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;CONVERT&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span class="kwrd"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;varchar&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;, &lt;/span&gt;&lt;/span&gt;&lt;span class="kwrd"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;MAX&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;(b.[backup_finish_date]), 109), &lt;/span&gt;&lt;/span&gt;&lt;span class="str"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;'No backups'&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;) &lt;/span&gt;&lt;/span&gt;&lt;span class="kwrd"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;AS&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="str"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;'Last Backed up Date/Time'&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;,&lt;br /&gt;ISNULL(b.[user_name], &lt;/span&gt;&lt;/span&gt;&lt;span class="str"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;'N/A'&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;) &lt;/span&gt;&lt;/span&gt;&lt;span class="kwrd"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;AS&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="str"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;'User'&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;, ISNULL(b.[type], &lt;/span&gt;&lt;/span&gt;&lt;span class="str"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;'-'&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;) &lt;/span&gt;&lt;/span&gt;&lt;span class="kwrd"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;AS&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="str"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;'Backup Type'&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="kwrd"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;FROM&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;sys.databases d&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="kwrd"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;LEFT&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="kwrd"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;OUTER&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="kwrd"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;JOIN&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt; msdb.dbo.backupset b &lt;/span&gt;&lt;/span&gt;&lt;span class="kwrd"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;ON&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt; d.name = b.database_name&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="kwrd"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;GROUP&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="kwrd"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;BY&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;d.[name], b.[user_name], b.[type]&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;span&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;While this is the code to get a list of the latest restore operations performed against your databases:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="border-width:2px; border-style:solid; padding:10px"&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;SELECT&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;d.[name],&lt;br /&gt;ISNULL(&lt;/span&gt;&lt;/span&gt;&lt;span class="kwrd"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;CONVERT&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span class="kwrd"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;varchar&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;, &lt;/span&gt;&lt;/span&gt;&lt;span class="kwrd"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;MAX&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;(r.[restore_date]), 109), &lt;/span&gt;&lt;/span&gt;&lt;span class="str"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;'No restores'&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;) &lt;/span&gt;&lt;/span&gt;&lt;span class="kwrd"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;AS&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="str"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;'Last Restored up Date/Time'&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;,&lt;br /&gt;ISNULL(r.[user_name], &lt;/span&gt;&lt;/span&gt;&lt;span class="str"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;'N/A'&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;) &lt;/span&gt;&lt;/span&gt;&lt;span class="kwrd"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;AS&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="str"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;'User'&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;,&lt;br /&gt;ISNULL(r.[restore_type], &lt;/span&gt;&lt;/span&gt;&lt;span class="str"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;'-'&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;) &lt;/span&gt;&lt;/span&gt;&lt;span class="kwrd"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;AS&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class="str"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;'Backup Type'&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="kwrd"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;FROM&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;sys.databases d&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="kwrd"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;LEFT&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="kwrd"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;OUTER&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="kwrd"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;JOIN&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt; msdb.dbo.restorehistory r &lt;/span&gt;&lt;/span&gt;&lt;span class="kwrd"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;ON&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt; d.[name] = r.[destination_database_name]&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="kwrd"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;GROUP&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="kwrd"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;BY&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;d.[name], r.[user_name], r.[restore_type] &lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;span&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;You could stuff more details into this code, from the tables listed above to suit your requirements.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;&lt;!-- google_ad_client = "pub-2528130281382044"; /* Leaderboard_01 */ google_ad_slot = "0666121777"; google_ad_width = 728; google_ad_height = 90; //--&gt;&lt;br /&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;br /&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36623110-3479318857610225876?l=dbantics.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://dbantics.blogspot.com/feeds/3479318857610225876/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dbantics.blogspot.com/2009/02/date-of-latest-backuprestore.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/36623110/posts/default/3479318857610225876?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/36623110/posts/default/3479318857610225876?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DBAntics/~3/YXoV-dLj5U0/date-of-latest-backuprestore.html" title="Date of Latest Backup/Restore" /><author><name>Gogula G. Aryalingam</name><uri>http://www.blogger.com/profile/17902540052308703629</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="00699112592523224881" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://dbantics.blogspot.com/2009/02/date-of-latest-backuprestore.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUEAQno4eSp7ImA9WxVWFkk.&quot;"><id>tag:blogger.com,1999:blog-36623110.post-6376623848818358223</id><published>2008-04-11T15:41:00.007+05:30</published><updated>2009-02-26T15:50:43.431+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-02-26T15:50:43.431+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SSIS" /><category scheme="http://www.blogger.com/atom/ns#" term="Integration Services" /><title>Office Excel 2007 and SSIS</title><content type="html">&lt;p style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;Most of us know how to make use of an Office Excel file in an SSIS package. As long as you use an Excel file with the .xls extension (i.e. Office 3.0, 4.0, 5.0 or Office 97 - 2003 format) you'd be fine. But, when it comes to Office Excel 2007 you'd want to do it differently. The &lt;/span&gt;&lt;em&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;Connection manager for Excel files&lt;/span&gt;&lt;/em&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt; option that you would usually choose would not work.&lt;/span&gt;&lt;/p&gt;  &lt;p style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;Since Office Excel 2007 and its &lt;/span&gt;&lt;em&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;.xlsx&lt;/span&gt;&lt;/em&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt; extension came long after SQL Server 2005 and since this new format is entirely different from the previous formats we had a little problem.&lt;/span&gt;&lt;/p&gt;  &lt;p style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;This was sorted out with Microsoft releasing the infamous Service Pack 2 (infamous 'cos it had some other issues). Anyway this Service Pack gave us a new driver which could be used for Office Excel 2007 (a.k.a. Excel 12.0) files.&lt;/span&gt;&lt;/p&gt;  &lt;p style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;I have briefed below the steps used for creating a connection to an Excel 12.0 file.&lt;/span&gt;&lt;/p&gt;  &lt;p style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;In a new or existing package,&lt;/span&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;Add a &lt;/span&gt;&lt;em&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;New Connection&lt;/span&gt;&lt;/em&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt; and choose the appropriate connection manager type (ADO.NET or OLEDB) by right-clicking on the &lt;/span&gt;&lt;em&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;Connection Managers&lt;/span&gt;&lt;/em&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt; section. &lt;/span&gt;&lt;/li&gt;    &lt;li style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;This will pop up the appropriate &lt;/span&gt;&lt;em&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;Configuration Connection Manager &lt;/span&gt;&lt;/em&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;box. &lt;/span&gt;&lt;/li&gt;    &lt;li style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;Click on &lt;/span&gt;&lt;em&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;New...&lt;/span&gt;&lt;/em&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt; and under the &lt;/span&gt;&lt;em&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;Provider&lt;/span&gt;&lt;/em&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt; drop-down, select &lt;/span&gt;&lt;em&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;Microsoft Office 12.0 Access Database Engine OLE DB Provider &lt;/span&gt;&lt;/em&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;(yes, it is made to be used with Excel files as well). &lt;/span&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/gogulaa/SBA751VKEhI/AAAAAAAAAEs/RaGQE930iKM/s1600-h/NewConnection_Provider%5B10%5D.jpg"&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" border="0" alt="NewConnection_Provider" src="http://lh6.ggpht.com/gogulaa/SBA771VKEiI/AAAAAAAAAE0/6NjGrY4QRhk/NewConnection_Provider_thumb%5B8%5D.jpg?imgmax=800" width="429" height="436" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;Click on the &lt;/span&gt;&lt;em&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;All&lt;/span&gt;&lt;/em&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt; tab of the tab strip located on the left, and type the following against the &lt;/span&gt;&lt;em&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;Extended Properties&lt;/span&gt;&lt;/em&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt; property: "Excel 12.0". &lt;/span&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/gogulaa/SBA8AFVKEjI/AAAAAAAAAE8/oPs3_jHp3t4/s1600-h/ExtendedProperties%5B3%5D.jpg"&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" border="0" alt="ExtendedProperties" src="http://lh6.ggpht.com/gogulaa/SBA8B1VKEkI/AAAAAAAAAFE/URb53NhA8Hg/ExtendedProperties_thumb%5B1%5D.jpg?imgmax=800" width="419" height="167" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;Go back to the &lt;/span&gt;&lt;em&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;Connections&lt;/span&gt;&lt;/em&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt; tab and type in the full file path of the Excel 2007 file. &lt;/span&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/gogulaa/SBA8DVVKElI/AAAAAAAAAFM/2cyho5M2q6c/s1600-h/Filename%5B4%5D.jpg"&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" border="0" alt="Filename" src="http://lh6.ggpht.com/gogulaa/SBA8E1VKEmI/AAAAAAAAAFU/A12gJVemxro/Filename_thumb%5B2%5D.jpg?imgmax=800" width="421" height="178" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;And you're done! Remember; when you use the connection manager within a Data Flow task, use an OLEDB Source or Destination instead of an Excel Source or Destination. &lt;/span&gt;&lt;/li&gt; &lt;/ul&gt;&lt;p align="center"&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;&lt;iframe height="60" marginheight="0" src="http://pagead2.googlesyndication.com/pagead/ads?client=ca-pub-2528130281382044&amp;amp;dt=1209034140899&amp;amp;lmt=1209034140&amp;amp;output=html&amp;amp;slotname=1055406663&amp;amp;correlator=1209034140453&amp;amp;url=file%3A%2F%2F%2FC%3A%2FUsers%2FGogulaa%2FAppData%2FLocal%2FTemp%2FWindowsLiveWriter-429641856%2F160940986D18%2Findex.htm&amp;amp;frm=0&amp;amp;cc=100&amp;amp;ga_vid=1790101765.1209034141&amp;amp;ga_sid=1209034141&amp;amp;ga_hid=870763395&amp;amp;flash=9.0.115.0&amp;amp;u_h=1200&amp;amp;u_w=1600&amp;amp;u_ah=1170&amp;amp;u_aw=1600&amp;amp;u_cd=32&amp;amp;u_tz=330&amp;amp;u_java=true" frameborder="0" width="468" allowtransparency="allowtransparency" name="google_ads_frame" marginwidth="0" scrolling="no"&gt;&lt;/iframe&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/36623110-6376623848818358223?l=dbantics.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://dbantics.blogspot.com/feeds/6376623848818358223/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dbantics.blogspot.com/2008/04/office-excel-2007-and-ssis.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/36623110/posts/default/6376623848818358223?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/36623110/posts/default/6376623848818358223?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DBAntics/~3/v5bNQeoTZuQ/office-excel-2007-and-ssis.html" title="Office Excel 2007 and SSIS" /><author><name>Gogula G. Aryalingam</name><uri>http://www.blogger.com/profile/17902540052308703629</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="00699112592523224881" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://dbantics.blogspot.com/2008/04/office-excel-2007-and-ssis.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkAERX8_fip7ImA9WxVWFkk.&quot;"><id>tag:blogger.com,1999:blog-36623110.post-7764726835818365607</id><published>2008-03-24T11:58:00.005+05:30</published><updated>2009-02-26T16:08:24.146+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-02-26T16:08:24.146+05:30</app:edited><title>The hierarchyid data type</title><content type="html">&lt;p&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;I have published my article titled &lt;/span&gt;&lt;a title="SQL Server 2008 - The hierarchyid data type" href="http://sqlserveruniverse.com/content/TSQL0500103242008HierarchyidDataType.aspx" target="_blank"&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;SQL Server 2008 -  The hierarchyid data type&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;, on &lt;/span&gt;&lt;a title="SQLServerUniverse.com" href="http://sqlserveruniverse.com/" target="_blank"&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;SQLServerUniverse.com&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;.&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;Just to let you know, the hierarchyid data type is a CLR data type introduced in SQL Server 2008, and is used for storing hierarchical data. Unlike the parent/child approach which maintains a relationship among the records, this approach maintains &lt;/span&gt;&lt;em&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;the level&lt;/span&gt;&lt;/em&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt; and &lt;/span&gt;&lt;em&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;the position within the level &lt;/span&gt;&lt;/em&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;to keep track of the records' hierarchy.&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.google.com/gogulaa/R-dJ7142ULI/AAAAAAAAAEU/ms0rPnMPkKE/TSQL04001_04%5B3%5D.jpg"&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" border="0" alt="TSQL04001_04" src="http://lh3.google.com/gogulaa/R-dJ9V42UMI/AAAAAAAAAEc/9_o-zeOxvZw/TSQL04001_04_thumb%5B1%5D.jpg" width="260" height="153" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;So, go ahead read, please my article and let me know on your thoughts.&lt;/span&gt;&lt;/p&gt;&lt;p align="center"&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;&lt;iframe height="60" marginheight="0" src="http://pagead2.googlesyndication.com/pagead/ads?client=ca-pub-2528130281382044&amp;amp;dt=1209034140899&amp;amp;lmt=1209034140&amp;amp;output=html&amp;amp;slotname=1055406663&amp;amp;correlator=1209034140453&amp;amp;url=file%3A%2F%2F%2FC%3A%2FUsers%2FGogulaa%2FAppData%2FLocal%2FTemp%2FWindowsLiveWriter-429641856%2F160940986D18%2Findex.htm&amp;amp;frm=0&amp;amp;cc=100&amp;amp;ga_vid=1790101765.1209034141&amp;amp;ga_sid=1209034141&amp;amp;ga_hid=870763395&amp;amp;flash=9.0.115.0&amp;amp;u_h=1200&amp;amp;u_w=1600&amp;amp;u_ah=1170&amp;amp;u_aw=1600&amp;amp;u_cd=32&amp;amp;u_tz=330&amp;amp;u_java=true" frameborder="0" width="468" allowtransparency="allowtransparency" name="google_ads_frame" marginwidth="0" scrolling="no"&gt;&lt;/iframe&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/36623110-7764726835818365607?l=dbantics.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://dbantics.blogspot.com/feeds/7764726835818365607/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dbantics.blogspot.com/2008/03/hierarchyid-data-type.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/36623110/posts/default/7764726835818365607?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/36623110/posts/default/7764726835818365607?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DBAntics/~3/RfPQZ2x9GAI/hierarchyid-data-type.html" title="The hierarchyid data type" /><author><name>Gogula G. Aryalingam</name><uri>http://www.blogger.com/profile/17902540052308703629</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="00699112592523224881" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://dbantics.blogspot.com/2008/03/hierarchyid-data-type.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEUMRHw_fip7ImA9WxZWEk8.&quot;"><id>tag:blogger.com,1999:blog-36623110.post-6562579431349246821</id><published>2008-03-11T13:25:00.002+05:30</published><updated>2008-03-11T13:28:05.246+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-03-11T13:28:05.246+05:30</app:edited><title>The Case of the Uninstallable CTP</title><content type="html">&lt;p&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;SQL Server 2008 CTP - February 2008&lt;/em&gt; comes with &lt;/span&gt;&lt;a href="http://en.wikipedia.org/wiki/PowerShell" target="_blank"&gt;&lt;span style="font-size:85%;"&gt;Windows PowerShell&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:85%;"&gt;. PowerShell is installed as a prerequisite. So one fine day when I decided to install the CTP on my Vista Ultimate SP1 box, since I had just rebuilt the PC from scratch, I was faced with an error while running the setup. The thing which puzzled me was that I had been able to successfully setup the same CTP on Vista Ultimate SP1 RC before (i.e. before rebuilding the PC). The error that pops up is this:&lt;br /&gt;&lt;/span&gt;&lt;a href="http://lh3.google.com/gogulaa/R9Y69A2sCZI/AAAAAAAAAD0/AAStAygGI_g/image%5B13%5D"&gt;&lt;span style="font-size:85%;"&gt;&lt;img style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" border="0" alt="image" src="http://lh3.google.com/gogulaa/R9Y6-A2sCaI/AAAAAAAAAD8/lFHHVl2aA-M/image_thumb%5B9%5D" width="392" height="198" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;This led me to do some sleuthing around as any one of us would do: Located the PowerShell folder within the CTP disc. PowerShell comes in the form of an &lt;em&gt;.msu&lt;/em&gt; (Microsoft System Update) file for Windows Vista. Double-clicking on it to manually install PowerShell resulted in this error:&lt;br /&gt;&lt;/span&gt;&lt;a href="http://lh3.google.com/gogulaa/R9Y6_A2sCbI/AAAAAAAAAEE/IHv0xFdX6K4/image%5B14%5D"&gt;&lt;span style="font-size:85%;"&gt;&lt;img style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" border="0" alt="image" src="http://lh5.google.com/gogulaa/R9Y7Ag2sCcI/AAAAAAAAAEM/MFdItoRvovs/image_thumb%5B10%5D" width="401" height="174" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;The real problem can be identified only here. There was some service which was not started up, in order to execute the PowerShell msu file. So which service is responsible for running Windows updates? &lt;em&gt;Windows Update&lt;/em&gt;, of course. And true enough, Windows Update was disabled. Enabling it and starting it allowed the SQL Server installation to go through uninterrupted.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;So, always remember to make sure that the Windows Update service is started up before setting up SQL Server 2008. Not quite sure what would happen on Windows Server or Windows XP though, since they don't use &lt;em&gt;msu&lt;/em&gt; files...&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/36623110-6562579431349246821?l=dbantics.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://dbantics.blogspot.com/feeds/6562579431349246821/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dbantics.blogspot.com/2008/03/case-of-uninstallable-ctp.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/36623110/posts/default/6562579431349246821?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/36623110/posts/default/6562579431349246821?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DBAntics/~3/LQm1erITMpo/case-of-uninstallable-ctp.html" title="The Case of the Uninstallable CTP" /><author><name>Gogula G. Aryalingam</name><uri>http://www.blogger.com/profile/17902540052308703629</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="00699112592523224881" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://dbantics.blogspot.com/2008/03/case-of-uninstallable-ctp.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUcNQ3s5cCp7ImA9WB5SEUQ.&quot;"><id>tag:blogger.com,1999:blog-36623110.post-2905787408169327255</id><published>2007-06-07T10:32:00.001+05:30</published><updated>2007-06-07T10:41:32.528+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2007-06-07T10:41:32.528+05:30</app:edited><title>Under a Spell</title><content type="html">&lt;span style="font-size:85%;"&gt;What's up with QA at Microsoft these days? I was trying to setup a Back Up Database task in an SSIS package when I caught something from the corner of my eye. Check out the name of the highlighted property:&lt;/span&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_ekbL4Mfw8E0/RmeS6ghVdkI/AAAAAAAAAAU/avF57wOILdE/s1600-h/Back+Up+Database+Task+Properties.JPG"&gt;&lt;img style="cursor: pointer;" src="http://bp0.blogger.com/_ekbL4Mfw8E0/RmeS6ghVdkI/AAAAAAAAAAU/avF57wOILdE/s400/Back+Up+Database+Task+Properties.JPG" alt="" id="BLOGGER_PHOTO_ID_5073185039115974210" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36623110-2905787408169327255?l=dbantics.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://dbantics.blogspot.com/feeds/2905787408169327255/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dbantics.blogspot.com/2007/06/under-spell.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/36623110/posts/default/2905787408169327255?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/36623110/posts/default/2905787408169327255?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DBAntics/~3/OrU3bB1Rp08/under-spell.html" title="Under a Spell" /><author><name>Gogula G. Aryalingam</name><uri>http://www.blogger.com/profile/17902540052308703629</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="00699112592523224881" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://bp0.blogger.com/_ekbL4Mfw8E0/RmeS6ghVdkI/AAAAAAAAAAU/avF57wOILdE/s72-c/Back+Up+Database+Task+Properties.JPG" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://dbantics.blogspot.com/2007/06/under-spell.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUUERH06cCp7ImA9WxZSFUw.&quot;"><id>tag:blogger.com,1999:blog-36623110.post-2146423103063174854</id><published>2007-06-01T15:16:00.000+05:30</published><updated>2008-01-28T16:16:45.318+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-01-28T16:16:45.318+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Integration Services" /><title>Should we send the Wizard back to Hogwarts?</title><content type="html">&lt;span style="font-family:verdana;font-size:85%;"&gt;The &lt;em&gt;SQL Server Import and Export Wizard&lt;/em&gt; in SQL Server 2005 is a handy tool to quickly transfer data from one data source to another, though on most occasions I use it to transfer data between two SQL Server instances. During these data transfer sessions, I always could not connect to a particular SQL Server instance using SQL authentication, though I could connect to it throught SSMS without any worries. The only difference between this particular SQL Server and the others was that, this one had the password as &lt;em&gt;&lt;strong&gt;P@ssW0r;D&lt;/strong&gt;&lt;/em&gt;. Whereas the others had simple passwords; either &lt;em&gt;&lt;strong&gt;blip&lt;/strong&gt;&lt;/em&gt; or &lt;em&gt;&lt;strong&gt;bleep&lt;/strong&gt;&lt;/em&gt;. So where would the problem lie? &lt;/span&gt;&lt;p  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;Well you see, the Import and Export wizard in its internals uses SSIS, and within that it uses an OLEDB connection. An as usual an OLEDB connection uses a connection string, and when the password is given in the connection string... all hell breaks lose (if I were to exaggerate a little). Why you ask? Because the connection string would now have an extra ';' in its midst:&lt;br /&gt;&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,160);font-family:courier new;font-size:85%;"  &gt;Data Source=SERVERX;User ID=sa;Password=P@ssW0r;D;Initial Catalog=DBX&lt;/span&gt; &lt;/p&gt;&lt;p  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;To correct this problem, I simply included double quotes at the beginning and at the end of the password in the password field of the wizard.&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_ekbL4Mfw8E0/Rl_sVyJpyVI/AAAAAAAAAAM/d5bbdJAsQnQ/s1600-h/ImportExportWiz.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5071031564426135890" style="CURSOR: pointer" alt="" src="http://bp1.blogger.com/_ekbL4Mfw8E0/Rl_sVyJpyVI/AAAAAAAAAAM/d5bbdJAsQnQ/s400/ImportExportWiz.JPG" border="0" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;/p&gt;&lt;p  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;This worked like a charm, since the connection string in the internal workings of the wizard would now look something like this:&lt;br /&gt;&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,160);font-family:courier new;font-size:85%;"  &gt;Data Source=SERVERX;User ID=sa;Password="P@ssW0r;D"Initial Catalog=DBX&lt;/span&gt; &lt;/p&gt;&lt;p  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;Now, this got me thinking: "What if my password contained a semi-colon (&lt;/span&gt;&lt;span style="COLOR: rgb(128,128,255);font-size:85%;" &gt;;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;) &lt;em&gt;and&lt;/em&gt; a double-quote (&lt;strong&gt;&lt;span style="COLOR: rgb(128,128,255)"&gt;"&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,0)"&gt;)&lt;/span&gt;&lt;/strong&gt; ?"&lt;br /&gt;Answer: I didn't want to find out. &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/36623110-2146423103063174854?l=dbantics.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://dbantics.blogspot.com/feeds/2146423103063174854/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dbantics.blogspot.com/2007/06/should-we-send-wizard-back-to-hogwarts.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/36623110/posts/default/2146423103063174854?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/36623110/posts/default/2146423103063174854?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DBAntics/~3/wTlESMCF0RQ/should-we-send-wizard-back-to-hogwarts.html" title="Should we send the Wizard back to Hogwarts?" /><author><name>Gogula G. Aryalingam</name><uri>http://www.blogger.com/profile/17902540052308703629</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="00699112592523224881" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://bp1.blogger.com/_ekbL4Mfw8E0/Rl_sVyJpyVI/AAAAAAAAAAM/d5bbdJAsQnQ/s72-c/ImportExportWiz.JPG" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://dbantics.blogspot.com/2007/06/should-we-send-wizard-back-to-hogwarts.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUcAQ307cSp7ImA9WB5SEUQ.&quot;"><id>tag:blogger.com,1999:blog-36623110.post-6239398217829082873</id><published>2007-04-22T19:31:00.001+05:30</published><updated>2007-06-07T10:40:42.309+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2007-06-07T10:40:42.309+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SSIS" /><category scheme="http://www.blogger.com/atom/ns#" term="ETL" /><title>Come Undone</title><content type="html">&lt;p&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:85%;"&gt;Recently I was working on some ETL packages to transfer some flat file information to a SQL Server 2005 staging table. The particular package that I was working required removing some header and trailing records and then transferring the rest of the data. Some of the trailing records can only be identified by a particular junk character that appeared towards the end of the file. This resulted in me checking for this character in a Script Task in the SSIS package and then removing the line, among other things. The code for this header and trailer removing phase was around 40 to 50 lines long. The problem was the script never executed. And when I went back to check the script the entire code in the Script Task was missing! (As if a technical David Copperfield had waved his wand over my code). I rewrote the code twice over, tried saving the entire project and all kinds of silly things, yet it wouldn't keep my code... Commenting line by line wouldn't work either.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;Only removing line by line showed me the perpetrator:&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);font-family:Courier New;font-size:85%;"  &gt;If str.Contains("&lt;span style="font-family:MT Extra;"&gt;?&lt;/span&gt;") Then    &lt;span style="color: rgb(0, 153, 0);"&gt;'ASCII Code 26 (Some fonts show it using a 'question mark' while others show a 'box')&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:85%;"&gt;So, myself goes and copies this character to the command prompt to see what this character actual is (This is because several different junk characters are denoted using "&lt;/span&gt;&lt;span style="font-family:MT Extra;font-size:85%;"&gt;?&lt;/span&gt;&lt;span style="font-size:85%;"&gt;"). Guess what showed up on the command prompt:&lt;br /&gt;&lt;strong&gt;^Z&lt;/strong&gt; (a.k.a Undo).&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:85%;"&gt;Which meant, every time I saved and closed the script, the whole set of code comes undone! A quick word of admonishment to myself for not using proper standards, I quickly rewrite the script once again, but this time using the ASCII value of the character instead.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;UPDATE: The above package was created using SP1 of SQL Server 2005. I just tried out the same thing with SP2, the issue seems partly fixed: The code doesn't disappear when I close the Script Editor Window, but is cleared once I close the entire projects and open it up, unless of course the offending character is removed in its entirety...&lt;br /&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/36623110-6239398217829082873?l=dbantics.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://dbantics.blogspot.com/feeds/6239398217829082873/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dbantics.blogspot.com/2007/04/come-undone.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/36623110/posts/default/6239398217829082873?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/36623110/posts/default/6239398217829082873?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DBAntics/~3/Mt-hLJH6lZA/come-undone.html" title="Come Undone" /><author><name>Gogula G. Aryalingam</name><uri>http://www.blogger.com/profile/17902540052308703629</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="00699112592523224881" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://dbantics.blogspot.com/2007/04/come-undone.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0QESHk_fCp7ImA9WBBRFUk.&quot;"><id>tag:blogger.com,1999:blog-36623110.post-5209219610366099223</id><published>2006-11-02T16:00:00.001+05:30</published><updated>2006-11-03T15:51:49.744+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2006-11-03T15:51:49.744+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SSIS" /><category scheme="http://www.blogger.com/atom/ns#" term="data mart" /><category scheme="http://www.blogger.com/atom/ns#" term="DTS" /><category scheme="http://www.blogger.com/atom/ns#" term="ETL" /><category scheme="http://www.blogger.com/atom/ns#" term="Slowly Changing Dimension" /><category scheme="http://www.blogger.com/atom/ns#" term="data warehouse" /><title>The 5 Year Difference</title><content type="html">&lt;div style="text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;Data Warehousing/Data Marting nearly always required the need for ETL. And most of the time it was the ETLing of data to create dimensions. And the one type of dimension I have worked with most is the type now known as &lt;em&gt;Slowly Changing Dimension &lt;/em&gt;(this term was not used much before the advent of SQL Server 2005, but still).&lt;/span&gt;&lt;/div&gt; &lt;p style="text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;The ETL tool that I have been using, Data Transformation Services of SQL Server 2000 was a decent enough tool for the purpose. I was quite content with it until; along came SQL Server 2005 carrying with it DTS's new form: SSIS (SQL Server Integration Services). SSIS gives you things which could only be dreamt when working with DTS.&lt;/span&gt;&lt;/p&gt; &lt;p style="text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;Let me now explain t&lt;/span&gt;&lt;span style="font-size:85%;"&gt;his magic through, how I would go about ETLing data from the source to a destination using each of the two technologies. First, DTS and then SSIS.&lt;/span&gt;&lt;/p&gt;   &lt;div style="text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;The source is a SQL Server 2000 table of Products already arranged in a parent-child hierarchy, and looking like this:&lt;/span&gt;&lt;a target="_blank" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger2/4870/4470/1600/Product%20-%20Source%20-%20Design.0.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://photos1.blogger.com/blogger2/4870/4470/200/Product%20-%20Source%20-%20Design.0.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a target="_blank" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger2/4870/4470/1600/Products%20-%20Source.0.jpg"&gt;&lt;img style="cursor: pointer;" src="http://photos1.blogger.com/blogger2/4870/4470/200/Products%20-%20Source.0.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;Th&lt;/span&gt;&lt;span style="font-size:85%;"&gt;e destination for the DTS process will be a SQL Server 2000 table laid out in a structure which would later make up a star schema, like this:&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;a target="_blank" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger2/4870/4470/1600/Product%20-%20Destination%20-%20Design.jpg"&gt;&lt;img style="cursor: pointer;" src="http://photos1.blogger.com/blogger2/4870/4470/200/Product%20-%20Destination%20-%20Design.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;while the destination for the SSIS process will be a SQL Server 2005 table laid out just like the one above, like this:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;&lt;a target="_blank" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger2/4870/4470/1600/Product%20-%20Destination%202005%20-%20Design.jpg"&gt;&lt;img style="cursor: pointer;" src="http://photos1.blogger.com/blogger2/4870/4470/200/Product%20-%20Destination%202005%20-%20Design.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;while the data after the ETL in both cases should look like this:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;&lt;a target="_blank" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger2/4870/4470/1600/Products%20-%20Source.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://photos1.blogger.com/blogger2/4870/4470/200/Products%20-%20Source.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;&lt;u&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;DTS Steps (SQL Server 2000)&lt;/u&gt;&lt;/span&gt;&lt;/p&gt; &lt;ul&gt; &lt;li style="text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;Create a new DTS package under &lt;em&gt;Data Transformation Services&lt;/em&gt; in &lt;em&gt;SQL Server Enterprise Manager&lt;/em&gt;.  &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Create two database connections.  &lt;/span&gt;&lt;ul&gt; &lt;li&gt;&lt;span style="font-size:85%;"&gt;One for the source  &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;The other for the destination&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt; &lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Add a &lt;em&gt;Data Driven Query Task&lt;/em&gt;. &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Write a SQL statement to build a nice result set to transfer, under &lt;em&gt;Source&lt;/em&gt; tab. &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Set the destination &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Create a &lt;em&gt;Lookup&lt;/em&gt; so that we could check whether the record which is being transfered is a new record or an existing record. &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Write an ActiveX script with logic to check if the record exists (using the &lt;span style="font-style: italic;"&gt;Lookup&lt;/span&gt; created earlier) in the destination and appropriately call the &lt;em&gt;Insert Query&lt;/em&gt; or the &lt;em&gt;Update Query&lt;/em&gt;. &lt;span style="font-style: italic; color: rgb(0, 0, 102);"&gt;(Takes quite a long time)&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Write the &lt;em&gt;Insert Query&lt;/em&gt; and the &lt;em&gt;Update Query&lt;/em&gt; and set their properties.&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;span style="font-size:85%;"&gt;&lt;u&gt;SSIS Steps (SQL Server 2005)&lt;/u&gt;&lt;/span&gt;&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;span style="font-size:85%;"&gt;Create a new &lt;em&gt;Integration Services&lt;/em&gt; project in &lt;em&gt;Business Intelligence Development Studio&lt;/em&gt;.&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="font-size:85%;"&gt;Create two connection managers for the source and destination.&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="font-size:85%;"&gt;Add a &lt;em&gt;Data Flow Task&lt;/em&gt;.&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="font-size:85%;"&gt;Add a &lt;em&gt;Data Flow Source&lt;/em&gt; to the task and set the source to it.&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="font-size:85%;"&gt;Add a &lt;em&gt;Slowly Changing Dimension&lt;/em&gt; object. (The wizard opens up to unveil the magic!)&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="font-size:85%;"&gt;Write a SQL statement to build a nice result set to transfer.&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="font-size:85%;"&gt;Continue with the wizard and voila!!! No ActiveX scripts, No lookups to worry about, No Insert Queries nor Update Queries!!! - Your ETL is done! Basically the only thing you wrote was the source query , which again can be built using the Query Builder.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:85%;"&gt;So now, I can build my dimensions quickly and that also without writing any code; just a series of clicks and drags!&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36623110-5209219610366099223?l=dbantics.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://dbantics.blogspot.com/feeds/5209219610366099223/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dbantics.blogspot.com/2006/11/5-year-difference.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/36623110/posts/default/5209219610366099223?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/36623110/posts/default/5209219610366099223?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DBAntics/~3/PHn6c_liGl4/5-year-difference.html" title="The 5 Year Difference" /><author><name>Gogula G. Aryalingam</name><uri>http://www.blogger.com/profile/17902540052308703629</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="00699112592523224881" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://dbantics.blogspot.com/2006/11/5-year-difference.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0QMQXwzcCp7ImA9WBBREkQ.&quot;"><id>tag:blogger.com,1999:blog-36623110.post-424004190881356377</id><published>2006-10-26T15:34:00.000+05:30</published><updated>2006-10-31T17:19:40.288+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2006-10-31T17:19:40.288+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="data mart" /><category scheme="http://www.blogger.com/atom/ns#" term="ETL" /><category scheme="http://www.blogger.com/atom/ns#" term="data warehouse" /><title>To VIEW or not to VIEW</title><content type="html">&lt;span style="font-size: 85%"&gt;&lt;b&gt;Imagine this scenario:&lt;/b&gt;&lt;/span&gt;&lt;br&gt;&lt;span style="font-size: 85%"&gt;An Oracle 9i database with tens of thousands of transactional data, which accumulates during the day. This data was to be ETLed to a Microsoft SQL Server 2000 data mart (in reality, a database), and a dimensional data mart (SQL Server 2000 Analysis Services database) will be then created on top of this relational data mart. All this should happen during the night and should be ready the following morning. That's because; when the day dawns, the decision makers would arrive. And when they do not find the properly updated cubes in the data mart, they would rather slice and dice my... um... donkey!&lt;/span&gt;&lt;br&gt;&lt;span style="font-size: 85%"&gt;&lt;/span&gt;&lt;br&gt;&lt;span style="font-size: 85%"&gt;Now to summarize what we have in the SQL Server 2000 database... We have dimension tables, transaction tables (which are being used for staging purposes) and fact tables (from which the cubes will be created). The dimension tables will be populated first, then the transaction tables and then the fact tables (which would get the data from the transactional data)&lt;/span&gt;&lt;br&gt;&lt;span style="font-size: 85%"&gt;&lt;/span&gt;&lt;br&gt;&lt;span style="font-size: 85%"&gt;Another hitch apart from all the data coming into the cubes before dawn, was that some transactions (i.e. the ones upto the previous 2 months) could change! Yes, you could well imagine my annoyance!&lt;/span&gt;&lt;br&gt;&lt;span style="font-size: 85%"&gt;&lt;/span&gt;&lt;br&gt;&lt;span style="font-size: 85%"&gt;But as I had to follow orders, I came up with a plan to delete transactional data from the current date to upto 2 months before on the transaction and fact tables and then perform the ETL from that point onward. But this would increase the amount of records which I had to ETL every night. But since the process was going ok and the decision makers were able to slice and dice their cubes everyday, I was fine.&lt;/span&gt;&lt;br&gt;&lt;span style="font-size: 85%"&gt;&lt;/span&gt;&lt;br&gt;&lt;span style="font-size: 85%"&gt;&lt;strong&gt;The Problem:&lt;/strong&gt;&lt;/span&gt;&lt;br&gt;&lt;span style="font-size: 85%"&gt;The problem started 2 months later, when the number of people who perform transactions started to increase. In the end the entire ETL was crawling on its belly for more than 12 hours!!! There were actually two things affecting this:&lt;/span&gt;&lt;br&gt; &lt;ol&gt; &lt;li&gt;&lt;span style="font-size: 85%"&gt;The large number of transactions&lt;/span&gt; &lt;li&gt;&lt;span style="font-size: 85%"&gt;The under-configured server (I couldn't take the blame alone, could I?)&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;&lt;span style="font-size: 85%"&gt;Coming back to the large number of transactions, I discovered something staggering! The ETL from Oracle to the staging transaction tables was happening quite fast (a little more than 2 hours), but the populating of data onto the fact tables was what was eating it all up! Imagine That! Transferring data from a couple of transactional tables to a fact table (both residing on the same database) taking close to half a day!&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size: 85%"&gt;Something worth noting is how the transaction table to fact table ETL was designed: Stored Procedures using cursors to lookup around half a dozen dimensions, twice or thrice over.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size: 85%"&gt;&lt;strong&gt;The Solution&lt;br&gt;&lt;/strong&gt;The solution that I implemented was: &lt;em&gt;dropped all the stored procedures&lt;/em&gt;, &lt;em&gt;dropped all the fact tables&lt;/em&gt;, &lt;em&gt;created views on top of the transaction tables, and made them look exactly like the fact tables&lt;/em&gt;. The next step was to fool the cubes into believing the views were actually the fact tables, which was quite simple. Then we changed the server, to match the required configuration. And voila! Man and machine solved the issue. The process now takes 1 1/2 hours tops to finish. &lt;/span&gt;&lt;/p&gt;&lt;b&gt;&lt;span style="font-size: 85%"&gt;Conclusion:&lt;/span&gt;&lt;br&gt;&lt;/b&gt;&lt;span style="font-size: 85%"&gt;Which of the solutions actually did the trick? I didn't want to find out. I'd like to believe it was both!&lt;/span&gt;&lt;br&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36623110-424004190881356377?l=dbantics.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://dbantics.blogspot.com/feeds/424004190881356377/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dbantics.blogspot.com/2006/10/to-view-or-not-to-view.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/36623110/posts/default/424004190881356377?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/36623110/posts/default/424004190881356377?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DBAntics/~3/0VAkPzy7MmU/to-view-or-not-to-view.html" title="To VIEW or not to VIEW" /><author><name>Gogula G. Aryalingam</name><uri>http://www.blogger.com/profile/17902540052308703629</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="00699112592523224881" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://dbantics.blogspot.com/2006/10/to-view-or-not-to-view.html</feedburner:origLink></entry></feed>
