<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:atom="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:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-5472362728893389722</atom:id><lastBuildDate>Sun, 27 Nov 2011 23:15:16 +0000</lastBuildDate><category>Visual Studio</category><category>user group</category><category>Visual Studio 2008</category><category>Script</category><category>Canberra</category><category>Database Project</category><category>GDR2</category><category>OleDB</category><category>SQL 2008</category><category>Certification</category><category>Office</category><category>SQL Server</category><category>VS2010</category><category>deployment</category><category>O'Reilly</category><category>meeting</category><category>Exam</category><category>SSIS</category><category>PASS</category><category>Visual Studio 2010</category><category>MDX</category><category>data dude</category><title>Shaun Baggett: Sorta SQL</title><description>Mostly SQL stuff...mostly.</description><link>http://shaunbaggett.blogspot.com/</link><managingEditor>noreply@blogger.com (Shaun Baggett)</managingEditor><generator>Blogger</generator><openSearch:totalResults>19</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/SortaSql" /><feedburner:info uri="sortasql" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5472362728893389722.post-8144562426856222322</guid><pubDate>Tue, 08 Mar 2011 20:03:00 +0000</pubDate><atom:updated>2011-03-09T07:09:04.128+11:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">meeting</category><category domain="http://www.blogger.com/atom/ns#">Canberra</category><category domain="http://www.blogger.com/atom/ns#">user group</category><title>The Canberra SQL Server User Group has moved web sites</title><description>&lt;p&gt;The Canberra SQL Server User Group has had some recent changes, primarily moving away from the sqlserver.org.au web site to one managed solely by the group.&lt;/p&gt;  &lt;p&gt;The new details are;&lt;/p&gt;  &lt;table border="0" cellspacing="0" cellpadding="2" width="580"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td width="165"&gt;         &lt;p align="right"&gt;eMail: &lt;/p&gt;       &lt;/td&gt;        &lt;td width="413"&gt;&lt;a href="mailto://csqlsug@gmail.com" target="_blank"&gt;csqlsug@gmail.com&lt;/a&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="165"&gt;         &lt;p align="right"&gt;Web Site: &lt;/p&gt;       &lt;/td&gt;        &lt;td width="413"&gt;&lt;a href="http://canberra.sqlpass.org" target="_blank"&gt;http://canberra.sqlpass.org&lt;/a&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="165"&gt;         &lt;p align="right"&gt;Meetings: &lt;/p&gt;       &lt;/td&gt;        &lt;td width="413"&gt;&lt;a href="http://www.eventbrite.com/org/744931271" target="_blank"&gt;http://www.eventbrite.com/org/744931271&lt;/a&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="165"&gt;         &lt;p align="right"&gt;LinkedIn: &lt;/p&gt;       &lt;/td&gt;        &lt;td width="413"&gt;&lt;a href="http://www.linkedin.com/groups?home=&amp;amp;gid=2028445" target="_blank"&gt;http://www.linkedin.com/groups?home=&amp;amp;gid=2028445&lt;/a&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="165"&gt;         &lt;p align="right"&gt;Facebook: &lt;/p&gt;       &lt;/td&gt;        &lt;td width="413"&gt;&lt;a href="http://www.facebook.com/group.php?gid=26112342248" target="_blank"&gt;http://www.facebook.com/group.php?gid=26112342248&lt;/a&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="165"&gt;         &lt;p align="right"&gt;Meetings RSS feed: &lt;/p&gt;       &lt;/td&gt;        &lt;td width="413"&gt;&lt;a href="http://feeds.feedburner.com/csqlsug" target="_blank"&gt;http://feeds.feedburner.com/csqlsug&lt;/a&gt;&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5472362728893389722-8144562426856222322?l=shaunbaggett.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SortaSql/~4/ZImEw1uA2hI" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SortaSql/~3/ZImEw1uA2hI/canberra-sql-server-user-group-has.html</link><author>noreply@blogger.com (Shaun Baggett)</author><thr:total>0</thr:total><feedburner:origLink>http://shaunbaggett.blogspot.com/2011/03/canberra-sql-server-user-group-has.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5472362728893389722.post-4322905489014709888</guid><pubDate>Thu, 28 Oct 2010 06:36:00 +0000</pubDate><atom:updated>2010-10-28T17:36:10.033+11:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">data dude</category><category domain="http://www.blogger.com/atom/ns#">Visual Studio 2010</category><category domain="http://www.blogger.com/atom/ns#">Database Project</category><category domain="http://www.blogger.com/atom/ns#">SQL 2008</category><category domain="http://www.blogger.com/atom/ns#">Visual Studio</category><category domain="http://www.blogger.com/atom/ns#">SQL Server</category><title>Database Projects again</title><description>&lt;p&gt;Tonight I'm presenting my Database Projects session at the Queensland SQL Server User Group.&lt;/p&gt;  &lt;p&gt;It will cover pretty much everything the last session did but this time I'm adding some bits on Post-Deployment scripts and how to use them to deploy data and database diagrams.&lt;/p&gt;  &lt;p&gt;I'll post a full blog on how database diagram deployment works in a few days.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5472362728893389722-4322905489014709888?l=shaunbaggett.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SortaSql/~4/1LaJxWbCp4M" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SortaSql/~3/1LaJxWbCp4M/database-projects-again.html</link><author>noreply@blogger.com (Shaun Baggett)</author><thr:total>0</thr:total><feedburner:origLink>http://shaunbaggett.blogspot.com/2010/10/database-projects-again.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5472362728893389722.post-8169382158828354051</guid><pubDate>Wed, 04 Aug 2010 09:32:00 +0000</pubDate><atom:updated>2010-08-04T19:32:34.083+10:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">data dude</category><category domain="http://www.blogger.com/atom/ns#">Visual Studio 2010</category><category domain="http://www.blogger.com/atom/ns#">Database Project</category><title>Second delivery of my Database Projects session</title><description>&lt;p&gt;Just presented the same session I presented at my user group last night to some of the people I work with.&lt;/p&gt;  &lt;p&gt;4 times as many as I had for my group, and I didn't have to supply pizza. &lt;/p&gt;  &lt;p&gt;I think I made some converts to the DB project cause.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5472362728893389722-8169382158828354051?l=shaunbaggett.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SortaSql/~4/dxfF9DVrhu4" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SortaSql/~3/dxfF9DVrhu4/second-delivery-of-my-database-projects.html</link><author>noreply@blogger.com (Shaun Baggett)</author><thr:total>0</thr:total><feedburner:origLink>http://shaunbaggett.blogspot.com/2010/08/second-delivery-of-my-database-projects.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5472362728893389722.post-3645698700609239644</guid><pubDate>Tue, 03 Aug 2010 23:35:00 +0000</pubDate><atom:updated>2010-08-04T09:36:26.254+10:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">data dude</category><category domain="http://www.blogger.com/atom/ns#">Visual Studio 2010</category><category domain="http://www.blogger.com/atom/ns#">Database Project</category><category domain="http://www.blogger.com/atom/ns#">Canberra</category><category domain="http://www.blogger.com/atom/ns#">user group</category><title>The August Canberra SQL Server User Group meeting was last night</title><description>&lt;p&gt;This month I presented a session called “A Database Project! What’s that?”&lt;/p&gt;  &lt;p&gt;It was a quick tour of what a database project was, and how to use it. It focused on the version that comes with Visual Studio 2010, but points out the differences to VS 2008 where necessary.&lt;/p&gt;  &lt;p&gt;It ended up being a very cosy session as just 3 group members showed up, although it was very timely for one member as his work place is just now introducing the concept of Database Projects.&lt;/p&gt;  &lt;p&gt;The consensus was that DB Projects rock, but I already knew that :)&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5472362728893389722-3645698700609239644?l=shaunbaggett.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SortaSql/~4/dx_J-G8Q-3M" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SortaSql/~3/dx_J-G8Q-3M/august-canberra-sql-server-user-group.html</link><author>noreply@blogger.com (Shaun Baggett)</author><thr:total>0</thr:total><feedburner:origLink>http://shaunbaggett.blogspot.com/2010/08/august-canberra-sql-server-user-group.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5472362728893389722.post-7331822020100369578</guid><pubDate>Thu, 20 May 2010 01:35:00 +0000</pubDate><atom:updated>2010-05-20T11:35:05.297+10:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">OleDB</category><category domain="http://www.blogger.com/atom/ns#">SSIS</category><category domain="http://www.blogger.com/atom/ns#">Script</category><category domain="http://www.blogger.com/atom/ns#">Office</category><title>64 bit Office OleDB drivers are finally available</title><description>&lt;p&gt;Just a quick blog to let folks know that Microsoft have recently released 64 bit MS Office drivers at &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=C06B8369-60DD-4B64-A44B-84B371EDE16D&amp;amp;displaylang=en" target="_blank"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyID=C06B8369-60DD-4B64-A44B-84B371EDE16D&amp;amp;displaylang=en&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;These are the Microsoft Office 2010 drivers and can be used for accessing Excel and Access files from within your .Net or SSIS script tasks when they are running in 64 bit mode.&lt;/p&gt;  &lt;p&gt;Note that the instructions from the link above refer to accessing Excel 2010. If you need to access an earlier version of Excel try using &amp;quot;Excel 12.0&amp;quot; in your extended properties.&lt;/p&gt;  &lt;p&gt;I have implemented these drivers on my SSIS server, and can now successfully run my SSIS packages in 64 bit mode and they happily access my Excel files.&lt;/p&gt;  &lt;p&gt;I haven't done any detailed benchmarks but initial comparisons between the same package running in 32 bit mode and 64 bit mode show some very good performance improvements.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5472362728893389722-7331822020100369578?l=shaunbaggett.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SortaSql/~4/pFIixe8Lrxc" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SortaSql/~3/pFIixe8Lrxc/64-bit-office-oledb-drivers-are-finally.html</link><author>noreply@blogger.com (Shaun Baggett)</author><thr:total>0</thr:total><feedburner:origLink>http://shaunbaggett.blogspot.com/2010/05/64-bit-office-oledb-drivers-are-finally.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5472362728893389722.post-2598240533801398774</guid><pubDate>Thu, 08 Apr 2010 00:29:00 +0000</pubDate><atom:updated>2010-04-08T10:29:05.442+10:00</atom:updated><title>I'm between jobs</title><description>&lt;p&gt;Just a quick note to say why I haven't blogged anything for a while, about me or the Canberra SQL User Group.&lt;/p&gt;  &lt;p&gt;I am currently unemployed, by choice. I have left the ACT Government and will be starting with &lt;a href="http://www.wardyit.com/" target="_blank"&gt;Wardy IT&lt;/a&gt; as of Monday April 19th. I expect that will be a lot of fun working with Peter and the gang.&lt;/p&gt;  &lt;p&gt;So my Wife Jennifer and I are having a bit of a break before the new job starts, as I expect I won't get any more leave for a while. We've just been camping with friends for 5 days (which is why there was no UG meeting this month) and are about to leave for Bali for 7 days.&lt;/p&gt;  &lt;p&gt;Good luck to Peter and Anthony with the &lt;a href="http://www.australianalm.com.au/" target="_blank"&gt;ALM Conference&lt;/a&gt; next week. Wish I could be there but Bali calls.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5472362728893389722-2598240533801398774?l=shaunbaggett.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SortaSql/~4/DS2Zlc1AfB0" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SortaSql/~3/DS2Zlc1AfB0/i-between-jobs.html</link><author>noreply@blogger.com (Shaun Baggett)</author><thr:total>0</thr:total><feedburner:origLink>http://shaunbaggett.blogspot.com/2010/04/i-between-jobs.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5472362728893389722.post-7339285651213638552</guid><pubDate>Wed, 03 Mar 2010 21:17:00 +0000</pubDate><atom:updated>2010-03-04T12:45:42.311+11:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">O'Reilly</category><category domain="http://www.blogger.com/atom/ns#">MDX</category><category domain="http://www.blogger.com/atom/ns#">SQL 2008</category><category domain="http://www.blogger.com/atom/ns#">Canberra</category><category domain="http://www.blogger.com/atom/ns#">SQL Server</category><category domain="http://www.blogger.com/atom/ns#">user group</category><title>March 2010 Canberra SQL User Group follow up</title><description>&lt;p&gt;Many thanks to Geoff Orr for his presentation on SQL MDX. I got a lot out of it and now realise it's not such a black art after all. &lt;/p&gt;&lt;p&gt;It was good to see that my giveaway book prize of &lt;strong&gt;&lt;a href="http://oreilly.com/catalog/9780735626188/"&gt;Microsoft SQL Server 2008 MDX Step by Step&lt;/a&gt;&lt;/strong&gt;, donated by &lt;a href="http://oreilly.com/"&gt;O'Reilly Publications&lt;/a&gt;, was one of Geoff's recommended reference manuals. As I had just given away my only copy of this book I have since purchased an electronic copy of the book from O'Reilly and it looks fantastic on my &lt;a href="http://www.amazon.com/Kindle-Wireless-Reading-Display-Generation/dp/B0015TG12Q/ref=kinww_ddp"&gt;Kindle DX&lt;/a&gt;, which is now available in Australia. Now to just find the time to read it.&lt;/p&gt;&lt;p&gt;Congratulations to Ben who won the book. He wasn't even planning to come to the meeting but was working with Geoff, our presenter, so tagged along when I picked Geoff up.&lt;/p&gt;&lt;p&gt;Other congratulations go to Thambap who won the copy of Windows 7 Ultimate Edition 64 bit that was donated by &lt;a href="http://www.usergroupsupportservices.com"&gt;Microsoft User Group Support Services&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;Thanks to both our sponsors, O'Reilly for the books, and Microsoft UGSS for the software and the pizza.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5472362728893389722-7339285651213638552?l=shaunbaggett.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SortaSql/~4/8uOa92CwJT8" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SortaSql/~3/8uOa92CwJT8/march-2010-canberra-sql-user-group_04.html</link><author>noreply@blogger.com (Shaun Baggett)</author><thr:total>0</thr:total><feedburner:origLink>http://shaunbaggett.blogspot.com/2010/03/march-2010-canberra-sql-user-group_04.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5472362728893389722.post-5533335698575220478</guid><pubDate>Tue, 02 Mar 2010 00:39:00 +0000</pubDate><atom:updated>2010-03-02T11:39:39.644+11:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">O'Reilly</category><category domain="http://www.blogger.com/atom/ns#">MDX</category><category domain="http://www.blogger.com/atom/ns#">Canberra</category><category domain="http://www.blogger.com/atom/ns#">SQL Server</category><category domain="http://www.blogger.com/atom/ns#">user group</category><title>The March 2010 Canberra SQL User Group Meeting is this evening with Geoff Orr</title><description>&lt;p&gt;Presenting for us this month is Geoff Orr with a presentation called 'MDX for SQL Dudes'. &lt;/p&gt;  &lt;p&gt;Geoff describes his presentation as follows; &lt;/p&gt;  &lt;p&gt;If your brain is wired for Transact-SQL and you're looking for a quick and dirty introduction to the weird and wonderful world of Multi-Dimensional eXpressions then this is the session for you. The syntax looks similar to SQL but does not work the same way. Cubes have far more metadata &amp;amp; MDX takes advantage of that. The session commences with an explanation of the basic concepts and principles underpinning the MDX language, contrasts it with TSQL and then proceeds to describe and demonstrate key syntax, MDX queries and some MDX scripting. Key Topics: Dimensions, Measure Groups and Members, How to do a join, How to add a condition, Where vs Filters. Perspectives, Accessing Properties, A few must know functions. &lt;/p&gt;  &lt;p&gt;Some info about Geoff; &lt;/p&gt;  &lt;p&gt;Geoff Orr is an MCAD with over 20 years experience in IT in Australia and the UK. Geoff works in Database, Development and Business Intelligence. He has worked on systems as diverse as government grants, logistics, finance and even rubbish trucks. Geoff believes that data has its own story and loves databases. Geoff has previously worked for Microsoft in Premier Support for SQL Server. &lt;/p&gt;  &lt;p&gt;This month we have 2 give away prizes for 2 lucky attendees that fill out an evaluation form; &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;strong&gt;Microsoft SQL Server 2008 MDX Step by Step&lt;/strong&gt; which was kindly donated by &lt;a href="http://oreilly.com"&gt;O'Reilly&lt;/a&gt; Publications. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Windows 7 Ultimate Edition 64 bit&lt;/strong&gt; courtesy of Microsoft User Group Support Services. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Please register your attendance for this meeting at &lt;a href="http://www.sqlserver.org.au"&gt;www.sqlserver.org.au&lt;/a&gt; or &lt;a href="http://www.usergroupsupportservices.com"&gt;www.usergroupsupportservices.com&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/5472362728893389722-5533335698575220478?l=shaunbaggett.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SortaSql/~4/_UZPTWP-l7M" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SortaSql/~3/_UZPTWP-l7M/march-2010-canberra-sql-user-group.html</link><author>noreply@blogger.com (Shaun Baggett)</author><thr:total>0</thr:total><feedburner:origLink>http://shaunbaggett.blogspot.com/2010/03/march-2010-canberra-sql-user-group.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5472362728893389722.post-6610273396176072072</guid><pubDate>Fri, 26 Feb 2010 04:52:00 +0000</pubDate><atom:updated>2010-02-26T16:19:49.550+11:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">data dude</category><category domain="http://www.blogger.com/atom/ns#">deployment</category><category domain="http://www.blogger.com/atom/ns#">Database Project</category><category domain="http://www.blogger.com/atom/ns#">SQL 2008</category><category domain="http://www.blogger.com/atom/ns#">Visual Studio</category><category domain="http://www.blogger.com/atom/ns#">SQL Server</category><title>Merge deploying data to SQL 2008 from Database Projects</title><description>&lt;p&gt;I have been trying out Microsoft's newest version of Visual Studio, the Visual Studio 2010 Ultimate Release Candidate. The new environment is quite nice although there doesn't seem to be a lot of difference with database projects so far. One nice extra is that you can now have windows tear off and be placed outside of the IDE. As I have multiple monitors I like to have the Solution Explorer open in the main IDE, and the Schema View window open on my second monitor. I find this greatly helps with quickly navigating around my project. &lt;/p&gt;  &lt;p&gt;Anyway, back to the blog post.&lt;/p&gt;  &lt;p&gt;When I am creating a new database schema, I like to have my project automatically load any required default data to my lookup tables. These tables are the ones where the data very rarely changes and are primarily referenced by Foreign keys. Examples of this table type could be a Status table, an Address type or even a Public Holiday date table that you'd like pre loaded. &lt;/p&gt;  &lt;p&gt;Where I work we have tried different ways to action this but all the solutions have depended on a post deployment script executing either a bulk copy or multiple insert statements as follows;&lt;/p&gt;  &lt;pre class="brush: sql"&gt;-- Non SQL 2008 version&lt;br /&gt;IF NOT EXISTS (SELECT 1 FROM [dbo].[TableName]) &lt;br /&gt;   BEGIN&lt;br /&gt;      INSERT [dbo].[TableName] ([Column1], [Column2])&lt;br /&gt;         VALUES (Value1, Value2);&lt;br /&gt;      INSERT [dbo].[TableName] ([Column1], [Column2])&lt;br /&gt;         VALUES (Value3, Value4);&lt;br /&gt;      INSERT [dbo].[TableName] ([Column1], [Column2])&lt;br /&gt;         VALUES (Value5, Value6);&lt;br /&gt;   END;&lt;br /&gt;&lt;br /&gt;-- SQL 2008 version&lt;br /&gt;IF NOT EXISTS (SELECT 1 FROM [dbo].[TableName]) &lt;br /&gt;   BEGIN&lt;br /&gt;      INSERT [dbo].[TableName] ([Column1], [Column2])&lt;br /&gt;         VALUES (Value1, Value2) &lt;br /&gt;              , (Value3, Value4) &lt;br /&gt;              , (Value5, Value6);&lt;br /&gt;   END;&lt;br /&gt;&lt;br /&gt;-- Bulk Copy version&lt;br /&gt;IF NOT EXISTS (SELECT 1 FROM [dbo].[TableName]) &lt;br /&gt;   BEGIN&lt;br /&gt;      BULK INSERT [dbo].[TableName] FROM '$(DataFilePath)TableName.bcp WITH ...&lt;br /&gt;   END;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;The main part of this that has always bothered me is the existence check as the first statement. This basically states that if ANY data exists in the target table, we assume that the table is already loaded correctly so nothing further occurs. The problem with this is that if your default table data changes, or has extra rows added, or has extra rows deleted, then unless you empty the target table before you run this script these changes are never made to the table when you deploy the project. &lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;Well this week, while working on a new SQL 2008 project, I realised that the new SQL 2008 only MERGE statement would be an ideal alternate method to pre load these lookup tables. With one statement I would be able to let SQL 2008 do all the work of comparing my project default data to what already exists in the deployment target database and take the appropriate action to either add or delete a row, depending on whether I have added or deleted a data row in my default data. &lt;br /&gt;&lt;br /&gt;&lt;br&gt;I set it up as follows for my AddressType table;&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: sql"&gt;-- Create the table&lt;br /&gt;CREATE TABLE [dbo].[AddressType]&lt;br /&gt;   (&lt;br /&gt;    [Id] INT IDENTITY(1, 1)&lt;br /&gt;             CONSTRAINT [PK_AddressType] PRIMARY KEY CLUSTERED&lt;br /&gt;             NOT NULL&lt;br /&gt;  , [Code] NVARCHAR(20) CONSTRAINT [UQ_AddressType_Code] UNIQUE ([Code])&lt;br /&gt;                        NOT NULL&lt;br /&gt;  , [Description] NVARCHAR(150) NULL&lt;br /&gt;   );&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Then I create a post deployment script LoadAddressType.sql in the database project with the following code in it; &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: sql"&gt;MERGE [dbo].[AddressType] AS Target&lt;br /&gt;   USING &lt;br /&gt;      (&lt;br /&gt;       SELECT N'Billing', N'Billing Address Type'&lt;br /&gt;       UNION ALL&lt;br /&gt;       SELECT N'Branch', N'Branch Address Type'&lt;br /&gt;       UNION ALL&lt;br /&gt;       SELECT N'Head Office', N'Head Office Address Type'&lt;br /&gt;       UNION ALL&lt;br /&gt;       SELECT N'Postal', N'Postal Address Type'&lt;br /&gt;       UNION ALL&lt;br /&gt;       SELECT N'Residential', N'Residential Address Type'&lt;br /&gt;      ) AS Source ([Code], [Description])&lt;br /&gt;   ON (TARGET.[Code] = SOURCE.[Code])&lt;br /&gt;   WHEN NOT MATCHED BY SOURCE&lt;br /&gt;      THEN DELETE &lt;br /&gt;   WHEN NOT MATCHED BY TARGET &lt;br /&gt;      THEN INSERT ([Code], [Description])&lt;br /&gt;         VALUES (SOURCE.[Code], SOURCE.[Description]) ;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;This creates a virtual Source table inside the USING block which, at project deployment is compared to the target table on the common [Code] field. If the target table has a row which is not in the virtual table then it is deleted from the target table and if the target table does not have a row which is in the virtual table, then the virtual row gets inserted to the target table. The first time this script is executed will insert 5 rows to the target AddressType table.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;If I were then to update the LoadAddressType.sql script as follows, deleting 'Branch' and modifying 'Head Office' to 'Central Office';&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: sql"&gt;MERGE [dbo].[AddressType] AS Target&lt;br /&gt;   USING &lt;br /&gt;      (&lt;br /&gt;       SELECT N'Billing', N'Billing Address Type'&lt;br /&gt;       UNION ALL&lt;br /&gt;       &lt;strong&gt;SELECT N'Central Office', N'Central Office Address Type'&lt;/strong&gt;&lt;br /&gt;       UNION ALL&lt;br /&gt;       SELECT N'Postal', N'Postal Address Type'&lt;br /&gt;       UNION ALL&lt;br /&gt;       SELECT N'Residential', N'Residential Address Type'&lt;br /&gt;      ) AS Source ([Code], [Description])&lt;br /&gt;   ON (TARGET.[Code] = SOURCE.[Code])&lt;br /&gt;   WHEN NOT MATCHED BY SOURCE&lt;br /&gt;      THEN DELETE &lt;br /&gt;   WHEN NOT MATCHED BY TARGET &lt;br /&gt;      THEN INSERT ([Code], [Description])&lt;br /&gt;         VALUES (SOURCE.[Code], SOURCE.[Description]) ;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Then on the next deployment of the project, the 2 rows with a [Code] value of 'Branch' and 'Head Office' would be deleted from the target table as they are no longer in the virtual table and a new row with a [Code] of 'Central Office' would be inserted. The other 3 rows would remain unchanged.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;If you wanted to extend the functionality so that the Description field gets updated if changed, then you could add the following code block to the merge which also compares the [Description] field;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: sql"&gt;MERGE [dbo].[AddressType] AS Target&lt;br /&gt;   USING &lt;br /&gt;      (&lt;br /&gt;       SELECT N'Billing', N'Billing Address Type'&lt;br /&gt;       UNION ALL&lt;br /&gt;       SELECT N'Central Office', N'Central Office Address Type'&lt;br /&gt;       UNION ALL&lt;br /&gt;       SELECT N'Postal', N'Postal Address Type'&lt;br /&gt;       UNION ALL&lt;br /&gt;       SELECT N'Residential', N'Residential Address Type'&lt;br /&gt;      ) AS Source ([Code], [Description])&lt;br /&gt;   ON (TARGET.[Code] = SOURCE.[Code])&lt;br /&gt;   &lt;strong&gt;WHEN MATCHED AND TARGET.[Description] &amp;lt;&amp;gt; SOURCE.[Description]&lt;br /&gt;      THEN UPDATE &lt;br /&gt;         SET TARGET.[Description] = SOURCE.[Description]&lt;/strong&gt;&lt;br /&gt;   WHEN NOT MATCHED BY SOURCE&lt;br /&gt;      THEN DELETE &lt;br /&gt;   WHEN NOT MATCHED BY TARGET &lt;br /&gt;      THEN INSERT ([Code], [Description])&lt;br /&gt;         VALUES (SOURCE.[Code], SOURCE.[Description]) ;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The way I have the virtual table coded relies on implicit data conversion for it's success, as well as being easier to read for blog entries but it really should be coded with the proper data type casting as follows;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: sql"&gt;MERGE [dbo].[AddressType] AS Target&lt;br /&gt;   USING &lt;br /&gt;      (&lt;br /&gt;       SELECT CAST('Billing' AS NVARCHAR(20)), CAST('Billing Address Type' AS NVARCHAR(150))&lt;br /&gt;       UNION ALL&lt;br /&gt;       SELECT CAST('Central Office' AS NVARCHAR(20)), CAST('Central Office Address Type' AS NVARCHAR(150))&lt;br /&gt;       UNION ALL&lt;br /&gt;       SELECT CAST('Postal' AS NVARCHAR(20)), CAST('Postal Address Type' AS NVARCHAR(150))&lt;br /&gt;       UNION ALL&lt;br /&gt;       SELECT CAST('Residential' AS NVARCHAR(20)), CAST('Residential Address Type' AS NVARCHAR(150))&lt;br /&gt;      ) AS Source ([Code], [Description])&lt;br /&gt;   ON (TARGET.[Code] = SOURCE.[Code])&lt;br /&gt;   WHEN NOT MATCHED BY SOURCE&lt;br /&gt;      THEN DELETE &lt;br /&gt;   WHEN NOT MATCHED BY TARGET &lt;br /&gt;      THEN INSERT ([Code], [Description])&lt;br /&gt;         VALUES (SOURCE.[Code], SOURCE.[Description]) ;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Note that you could also copy the Merge query into an SSMS query and run it directly to get the same results.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;One problem you may run into if you delete a value from your virtual source table is that come deployment, if that value is already referenced by a foreign key in another table, then unless you have the ON DELETE CASCADE option set for the foreign key the Merge statement will fail, causing your deployment to fail.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;This method works well for us for small amounts of default data, but is still not suitable for large scale Bulk Insert data loads as it would just take too long to set up the virtual table, not not mention it would probably not be very efficient. For these it is probably best to empty the target table before executing the bulk insert.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5472362728893389722-6610273396176072072?l=shaunbaggett.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SortaSql/~4/VM-t2BBl3Ew" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SortaSql/~3/VM-t2BBl3Ew/merge-deploying-data-to-sql-2008-from.html</link><author>noreply@blogger.com (Shaun Baggett)</author><thr:total>0</thr:total><feedburner:origLink>http://shaunbaggett.blogspot.com/2010/02/merge-deploying-data-to-sql-2008-from.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5472362728893389722.post-385966726825606551</guid><pubDate>Thu, 11 Feb 2010 02:19:00 +0000</pubDate><atom:updated>2010-02-11T13:53:52.875+11:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">deployment</category><category domain="http://www.blogger.com/atom/ns#">VS2010</category><category domain="http://www.blogger.com/atom/ns#">Database Project</category><category domain="http://www.blogger.com/atom/ns#">SQL Server</category><title>Visual Studio 2010 Release Candidate bug: SQL deployment property IgnoreFileAndLogFilePath</title><description>As you are probably aware by now, Microsoft this week made available the Release Candidate of Visual Studio 2010. It's looking like a nice product but still has a few issues.&lt;br /&gt;
&lt;br /&gt;
I was keen to upgrade an existing database solution I am working on so opened the solution and allowed the project upgrade wizard to complete. Everything looked great. All my projects were there, all the database objects and code were there, and it built successfully. But it wouldn't deploy. I would get this error on deployment;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: html"&gt;------ Build started: Project: BillingDB, Configuration: Debug Any CPU ------
BillingDB -&gt; D:\VS 2010 tests\Billing\Database\sql\BillingDB.dbschema
------ Deploy started: Project: BillingDB, Configuration: Debug Any CPU ------
D:\VS 2010 tests\Billing\Database\sql\Billing_BillingDB.sqldeployment(0,0): Error SQL00256: The deployment property IgnoreFileAndLogFilePath could not be used to configure deployment.
BillingDB.dbschema(0,0): Error TSD01234: The deployment configuration file could not be loaded. Deployment cannot continue
Done executing task "SqlDeployTask" -- FAILED.
Done building target "DspDeploy" in project "BillingDB.dbproj" -- FAILED.
Done executing task "CallTarget" -- FAILED.
Done building target "DBDeploy" in project "BillingDB.dbproj" -- FAILED.
Done building project "BillingDB.dbproj" -- FAILED.

Build FAILED.
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========
&lt;/pre&gt;After some investigation it seems that the VS 2008 database deployment property &lt;b&gt;IgnoreFileAndLogFilePath&lt;/b&gt; is no longer available in VS 2010, and that the upgrade process for database projects does not delete or modify this setting. Selecting Edit for the sqldeployment options, making a change, then saving the change, also does not remove the property from the file.&lt;br /&gt;
&lt;br /&gt;
The workaround is to open the &lt;b&gt;&amp;lt;project&amp;gt;.sqldeployment file&lt;/b&gt; in an editor of your choice and delete the line containing;&lt;br /&gt;
&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;lt;ignorefileandlogfilepath&amp;gt;True&amp;lt;/ignorefileandlogfilepath&amp;gt;&lt;/div&gt;Save the file and your database project should now deploy successfully.&lt;br /&gt;
&lt;br /&gt;
I didn't investigate further to see if there were any other deployment properties that no longer exist but now know how to fix it if I get the problem again.&lt;br /&gt;
&lt;br /&gt;
I created a &lt;a href="https://connect.microsoft.com/VisualStudio/feedback/details/532429/ignorefileandlogfilepath-setting-is-missing-in-vs-2010-upgraded-database-project-deployment"&gt;Microsoft Connect bug&lt;/a&gt; detailing the problem and I have had offline verification that it is a bug by Microsoft staff. They have now scheduled this to be fixed for the RTM of VS 2010.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="https://connect.microsoft.com/VisualStudio/feedback/details/532429/ignorefileandlogfilepath-setting-is-missing-in-vs-2010-upgraded-database-project-deployment"&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5472362728893389722-385966726825606551?l=shaunbaggett.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SortaSql/~4/wzDGOSFbm3U" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SortaSql/~3/wzDGOSFbm3U/visual-studio-2010-release-candidate.html</link><author>noreply@blogger.com (Shaun Baggett)</author><thr:total>1</thr:total><feedburner:origLink>http://shaunbaggett.blogspot.com/2010/02/visual-studio-2010-release-candidate.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5472362728893389722.post-5802214705363022985</guid><pubDate>Wed, 10 Feb 2010 01:26:00 +0000</pubDate><atom:updated>2010-02-10T12:26:31.239+11:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Exam</category><category domain="http://www.blogger.com/atom/ns#">Certification</category><title>My Microsoft Exams and Certifications</title><description>Just posting this so it's easy for me and possible employers to find .&lt;br /&gt;
&lt;br /&gt;
&lt;a href="https://mcp.microsoft.com/authenticate/validatemcp.aspx"&gt;https://mcp.microsoft.com/authenticate/validatemcp.aspx&lt;/a&gt;&lt;br /&gt;
TranscriptID: 746481&lt;br /&gt;
Access Code: sbaggett&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5472362728893389722-5802214705363022985?l=shaunbaggett.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SortaSql/~4/twnDsA3Frj4" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SortaSql/~3/twnDsA3Frj4/my-microsoft-exams-and-certifications.html</link><author>noreply@blogger.com (Shaun Baggett)</author><thr:total>0</thr:total><feedburner:origLink>http://shaunbaggett.blogspot.com/2010/02/my-microsoft-exams-and-certifications.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5472362728893389722.post-8459265721134232690</guid><pubDate>Mon, 08 Feb 2010 04:57:00 +0000</pubDate><atom:updated>2010-04-19T14:42:05.715+10:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Visual Studio 2008</category><category domain="http://www.blogger.com/atom/ns#">GDR2</category><category domain="http://www.blogger.com/atom/ns#">SQL Server</category><title>Be careful with comment location in pre/post deployment scripts</title><description>&lt;p&gt;Just had a small issue with my SQL Database project. &lt;br /&gt;
&lt;br /&gt;
In my Script.PostDeployment.sql file I put a standard SQL comment at the end of a line just to remind me of the required data load order;&lt;/p&gt;&lt;pre class="brush: sql"&gt;:r LoadLookupTable.sql
:r LoadTestData.sql  -- Must load LookupTable first&lt;/pre&gt;When building the project this caused the following error; &lt;pre&gt;&lt;/pre&gt;&lt;pre class="brush: html"&gt;C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v9.0\TeamData\Microsoft.Data.Schema.SqlTasks.targets(80,5)Error MSB4018: The "SqlSetupDeployTask" task failed unexpectedly.System.ArgumentException: Illegal characters in path.
at System.IO.Path.CheckInvalidPathChars(String path)
at System.IO.Path.IsPathRooted(String path)
at Microsoft.Data.Schema.Sql.Build.SqlDeploymentScriptModifier.GenerateMergedSqlCmdFiles(ContributorConfigurationSetup setup, ContributorConfigurationFile configFile)
at Microsoft.Data.Schema.Sql.Build.SqlDeploymentScriptModifier.OnEstablishDeploymentConfiguration(ContributorConfigurationSetup setup)
at Microsoft.Data.Schema.Build.DeploymentProjectBuilder.VerifyConfiguration()
at Microsoft.Data.Schema.Tasks.DBSetupDeployTask.BuildDeploymentProject(ErrorManager errors, ExtensionManager em)
at Microsoft.Data.Schema.Tasks.DBSetupDeployTask.Execute()
at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean&amp;amp; taskResult)
Done executing task "SqlSetupDeployTask" -- FAILED.
&lt;/pre&gt;By moving the comment to its own line like the following it then built correctly; &lt;pre class="brush: sql"&gt;:r LoadLookupTable.sql
-- Must load LookupTable first
:r LoadTestData.sql
&lt;/pre&gt;I know it's because it's being interpreted in SQLCMD mode but you'd think the parser would be smart enough to ignore it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5472362728893389722-8459265721134232690?l=shaunbaggett.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SortaSql/~4/lWevFTJHm6A" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SortaSql/~3/lWevFTJHm6A/be-careful-with-comment-location-in.html</link><author>noreply@blogger.com (Shaun Baggett)</author><thr:total>1</thr:total><feedburner:origLink>http://shaunbaggett.blogspot.com/2010/02/be-careful-with-comment-location-in.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5472362728893389722.post-5027075556516129667</guid><pubDate>Wed, 03 Feb 2010 22:00:00 +0000</pubDate><atom:updated>2010-02-11T14:02:28.428+11:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">data dude</category><category domain="http://www.blogger.com/atom/ns#">Visual Studio 2008</category><category domain="http://www.blogger.com/atom/ns#">GDR2</category><category domain="http://www.blogger.com/atom/ns#">SQL Server</category><title>Visual Studio 2008 Database Edition schema refactoring causes "Object Reference not set to an instance of an object"</title><description>I recently had a problem in a SQL 2008 database project. I am using Visual Studio 2008 Team Suite (which include the database Edition) with Service Pack 1 and the GDR2 database edition update installed.&lt;br /&gt;
&lt;br /&gt;
The problem was that no refactorings would work. By refactorings I am referring to the refactor options available from the Data menu or by right clicking a database object from the Schema View window of Visual Studio 2008. These include options such as Rename and Move schema.&lt;br /&gt;
&lt;br /&gt;
I would try to refactor an object, say to rename it. I would get the first dialog asking what I want to change and allowing me to select extra options such as Preview changes, Generate refactoring log, etc. Upon clicking OK from this dialog I would always get a further error dialog windows stating "Object Reference not set to an instance of an object.". This occurred every time, for any object that I tried to refactor, for any type of refactoring. The error dialog was also of the old style without the nice options to see the full error information or stack trace that is more common in most Visual Studio 2008 error dialogs.&lt;br /&gt;
&lt;br /&gt;
I attached a second instance of Visual Studio to the first instance and tried the refactoring again. The second instance managed to intercept some errors that were being thrown by the first instance and they consisted of multiple errors like the following;&lt;br /&gt;
&lt;pre class="brush: html"&gt;A first chance exception of type 'antlr.NoViableAltForCharException' occurred in Microsoft.Data.Schema.ScriptDom.Sql.dll
A first chance exception of type 'antlr.MismatchedTokenException' occurred in Microsoft.Data.Schema.ScriptDom.Sql.dll
A first chance exception of type 'System.NullReferenceException' occurred in Microsoft.Data.Schema.Sql.dll
&lt;/pre&gt;I was getting a bit out of my depth here so started a &lt;a href="http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/d3c376be-f6cc-463e-ade5-e95aa8c44112"&gt;thread &lt;/a&gt;on the Microsoft Visual Studio Team System Database Edition forum asking for help.&lt;br /&gt;
&lt;br /&gt;
After some forum discussion and guidance with Joyce Wang of Microsoft and further investigation by me to pinpoint the issue, the problem turned out to be a very obscure problem that they were aware of but does not occur very often.&lt;br /&gt;
&lt;br /&gt;
I had a post deployment SQL script in my project that used a CTE (Common table Expression) to load a Numbers table. Joyce explained that there is a bug in the VS 2008 GDR editions where post deployment scripts with CTE's cause this refactoring error, even though the script is valid and the database project both builds and deploys correctly. Joyce further explained that there is a way to not cause the refactoring error by adding a semi colon after the CTE closing bracket, but of course this then causes the script to no longer work when deployed as it is not the correct SQLsyntax for a CTE based query.&lt;br /&gt;
&lt;br /&gt;
The workaround is to exclude the pre or post deployment script from your database project, action all the refactorings you need to do, then include the script back in the project. Clunky but it gets the job done.&lt;br /&gt;
&lt;br /&gt;
This is apparently fixed in Visual Studio 2010 so I'll have to have a look at that soon.&lt;br /&gt;
&lt;br /&gt;
So, essentially this post is trying to explain that if you get this Object Reference error when refactoring, the most likely culprit is a pre or post deployment script that contains a CTE and the workaround is to exclude the script from the database project while you are doing your refactoring, then include it back in when you are done.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5472362728893389722-5027075556516129667?l=shaunbaggett.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SortaSql/~4/Ej-iMOG49i0" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SortaSql/~3/Ej-iMOG49i0/visual-studio-2008-database-edition.html</link><author>noreply@blogger.com (Shaun Baggett)</author><thr:total>0</thr:total><feedburner:origLink>http://shaunbaggett.blogspot.com/2010/02/visual-studio-2008-database-edition.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5472362728893389722.post-7331686931231383680</guid><pubDate>Tue, 02 Feb 2010 21:36:00 +0000</pubDate><atom:updated>2010-02-10T15:36:20.686+11:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">O'Reilly</category><category domain="http://www.blogger.com/atom/ns#">Canberra</category><category domain="http://www.blogger.com/atom/ns#">SQL Server</category><category domain="http://www.blogger.com/atom/ns#">user group</category><title>Canberra SQL UG with Kevin Wong</title><description>Last night (Feb 2nd 2010) was the first meeting of the Canberra SQL Server User group for 2010. This time we had our speaker, Kevin Wong, travel from Sydney to present a topic on SSIS 2008 new features such as ADO.Net connections, the Lookup Cache Connection Manager, using SSIS 2008 to create Reporting Services snapshots, package logging and more. Although there wasn't a large turnout, it was very well received and I think everyone learnt something new.&lt;br /&gt;
&lt;br /&gt;
The prize of Kalen Delaney's book SQL Server 2008 Internals, kindly donated to the group by &lt;a href="http://oreilly.com/"&gt;O'Reilly&lt;/a&gt; publications, was won by Mark Stafford. Congratulations Mark, some serious reading to do there.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5472362728893389722-7331686931231383680?l=shaunbaggett.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SortaSql/~4/aqDSWRPmacI" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SortaSql/~3/aqDSWRPmacI/canberra-sql-ug-with-kevin-wong.html</link><author>noreply@blogger.com (Shaun Baggett)</author><thr:total>0</thr:total><feedburner:origLink>http://shaunbaggett.blogspot.com/2010/02/canberra-sql-ug-with-kevin-wong.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5472362728893389722.post-2577057678485343538</guid><pubDate>Sun, 20 Dec 2009 23:42:00 +0000</pubDate><atom:updated>2010-02-10T15:36:53.627+11:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">data dude</category><category domain="http://www.blogger.com/atom/ns#">GDR2</category><category domain="http://www.blogger.com/atom/ns#">SQL Server</category><title>TSD03006 warnings in GDR2 Database Projects</title><description>At work we do a lot of Database development using Microsoft Visual Studio 2008 Team Suite, a component of which is the Database Edition. We have upgraded our database edition to the GDR2 release and it works great...mostly.&lt;br /&gt;
&lt;br /&gt;
Occasionally, in database solutions that have multiple database projects that include views that reference one of the other databases in the solution, we get lots of TSD03006 errors and warnings like the following;&lt;br /&gt;
&lt;br /&gt;
TSD03006: View: [dbo].[ViewName] has an unresolved reference to object [dbo].[Table]&lt;br /&gt;
&lt;br /&gt;
The thing is, the database reference exists correctly and the reference variables work fine for every other type of object, just not these views. This is something that was a known problem but was fixed in GDR2...except it still didn't work for us. None of the other suggestions I came across in my research worked, like deleting the .dbmdl file.&lt;br /&gt;
&lt;br /&gt;
For us it turned out to be a very hard to find problem with the database project collation. One of my co-workers, Phil, tracked it down as he was getting better warning messages from our build server than from Visual Studio that helped him target the culprit.&lt;br /&gt;
&lt;br /&gt;
If you open the .sqlsettings property file for your project, you define the project collation via a combo box like the following;&lt;br /&gt;
&lt;a href="http://1.bp.blogspot.com/_co-dyu9cq5Y/Sy66_rnmSHI/AAAAAAAAADU/lTSzuOXv050/s1600-h/Blog_20091221_1.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5417473004976621682" src="http://1.bp.blogspot.com/_co-dyu9cq5Y/Sy66_rnmSHI/AAAAAAAAADU/lTSzuOXv050/s320/Blog_20091221_1.png" style="cursor: pointer; display: block; height: 42px; margin: 0px auto 10px; text-align: center; width: 320px;" /&gt;&lt;/a&gt;&lt;br /&gt;
You can see that this has a Case Insensitive collation. Phil then went as far as manually opening the underlying .sqlsettings file that this project property page uses, only to find the following;&lt;br /&gt;
&lt;a href="http://2.bp.blogspot.com/_co-dyu9cq5Y/Sy68AuivJfI/AAAAAAAAADc/t7rSKOuQiBc/s1600-h/Blog_20091221_2.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5417474122453034482" src="http://2.bp.blogspot.com/_co-dyu9cq5Y/Sy68AuivJfI/AAAAAAAAADc/t7rSKOuQiBc/s320/Blog_20091221_2.png" style="cursor: pointer; display: block; height: 45px; margin: 0px auto 10px; text-align: center; width: 320px;" /&gt;&lt;/a&gt;&lt;br /&gt;
What the...?&lt;br /&gt;
&lt;br /&gt;
The underlying .sqlsettings file had the database collation as a Case Sensitive collation which would cause references to not be found if there was the slightest change in case between the target object and the referencing view. I don't know why the Visual Studio User Interface was not getting the collation value correctly but by manually editing the .sqlsettings file back to the Case Insensitive collation, all the TSD03006 reference errors disappeared.&lt;br /&gt;
&lt;br /&gt;
This has been very hard to reproduce, and once you have manually updated the .sqlsettings file the setting is correctly represented within the Visual Studio User Interface. We think it may be an issue that occured when our previous database projects were upgraded straight to GDR2, bypassing the first GDR upgrade.&lt;br /&gt;
&lt;br /&gt;
Hope this helps some other folks out.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5472362728893389722-2577057678485343538?l=shaunbaggett.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SortaSql/~4/uP2Zul8oamM" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SortaSql/~3/uP2Zul8oamM/tsd03006-warnings-in-gdr2-database.html</link><author>noreply@blogger.com (Shaun Baggett)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_co-dyu9cq5Y/Sy66_rnmSHI/AAAAAAAAADU/lTSzuOXv050/s72-c/Blog_20091221_1.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://shaunbaggett.blogspot.com/2009/12/tsd03006-warnings-in-gdr2-database.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5472362728893389722.post-7383952163413529444</guid><pubDate>Tue, 01 Dec 2009 21:55:00 +0000</pubDate><atom:updated>2009-12-16T21:46:02.243+11:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">PASS</category><category domain="http://www.blogger.com/atom/ns#">SQL Server</category><title>24 Hours of SQL PASS: The sessions are now available for viewing</title><description>I represented the Canberra SQL Server User Group by moderating one of the SQL 24 hours of PASS sessions back on 2009-09-02.&lt;br /&gt;&lt;br /&gt;The session I moderated was called &lt;span style="font-weight: bold;"&gt;Text Mining&lt;/span&gt; and was presented by Dejan Sarka. It was a lot of fun and thankfully there were no technical issues.&lt;br /&gt;&lt;br /&gt;This and the other 23 session recordings are available at: &lt;a href="http://24hours.sqlpass.org/Sessions.aspx"&gt;http://24hours.sqlpass.org/sessions.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5472362728893389722-7383952163413529444?l=shaunbaggett.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SortaSql/~4/DbhvDXvP2sM" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SortaSql/~3/DbhvDXvP2sM/24-hours-of-sql-pass-sessions-are-now.html</link><author>noreply@blogger.com (Shaun Baggett)</author><thr:total>0</thr:total><feedburner:origLink>http://shaunbaggett.blogspot.com/2009/12/24-hours-of-sql-pass-sessions-are-now.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5472362728893389722.post-7059443019765646921</guid><pubDate>Thu, 19 Nov 2009 02:42:00 +0000</pubDate><atom:updated>2009-12-16T21:44:55.399+11:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Canberra</category><category domain="http://www.blogger.com/atom/ns#">SQL Server</category><category domain="http://www.blogger.com/atom/ns#">user group</category><title>The Canberra SQL UG December meeting is my session</title><description>It's called &lt;span id="title"&gt;'SQL Server 2008 Integration Services Gotcha’s'&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span id="description"&gt;An informal look at some of the problems, hard to find bits and pieces, and workarounds that Shaun has found so far in SSIS 2008. I will cover things like passing locale independent dates to/from stored procedures, sorting issues, expression limitations and other stuff. We’ll also probably have time to help anyone who has SSIS related problems so bring along the hairy questions.&lt;br /&gt;&lt;br /&gt;The meeting starts about 17:30 on Dec 1, 2009.&lt;br /&gt;&lt;br /&gt;See &lt;a href="http://www.sqlserver.org.au"&gt;www.sqlserver.org.au&lt;/a&gt; for more information and registration.&lt;br /&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/5472362728893389722-7059443019765646921?l=shaunbaggett.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SortaSql/~4/qDwFIOkEmcU" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SortaSql/~3/qDwFIOkEmcU/canberra-sql-ug-december-meeting-is-my.html</link><author>noreply@blogger.com (Shaun Baggett)</author><thr:total>0</thr:total><feedburner:origLink>http://shaunbaggett.blogspot.com/2009/11/canberra-sql-ug-december-meeting-is-my.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5472362728893389722.post-6054953215111082571</guid><pubDate>Tue, 04 Aug 2009 02:08:00 +0000</pubDate><atom:updated>2009-08-04T12:14:30.886+10:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Canberra</category><category domain="http://www.blogger.com/atom/ns#">SQL Server</category><category domain="http://www.blogger.com/atom/ns#">user group</category><title>I'm the new Canberra SQL Server user group leader</title><description>I took this job on about a month ago after Jeff Wharton decided to step down after doing such a great job for the last couple of years.&lt;br /&gt;&lt;br /&gt;Tonight is my first meeting as leader, I hope it goes well.&lt;br /&gt;&lt;br /&gt;Our speaker this evening is Victor Isakov, a man very well known in the SQL Server world. His topic is DBA: Best Practices for All DBAs to Follow.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5472362728893389722-6054953215111082571?l=shaunbaggett.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SortaSql/~4/EV3qK1kCZRM" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SortaSql/~3/EV3qK1kCZRM/im-new-canberra-sql-server-user-group.html</link><author>noreply@blogger.com (Shaun Baggett)</author><thr:total>0</thr:total><feedburner:origLink>http://shaunbaggett.blogspot.com/2009/08/im-new-canberra-sql-server-user-group.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5472362728893389722.post-2033921034046518955</guid><pubDate>Fri, 03 Apr 2009 22:58:00 +0000</pubDate><atom:updated>2009-04-04T09:58:08.723+11:00</atom:updated><title>Shauns new Blog</title><description>&lt;p&gt;Hi&lt;/p&gt;  &lt;p&gt;My name is Shaun Baggett and this is my blog.&lt;/p&gt;  &lt;p&gt;It will be mainly focused in Microsoft SQL Server, but also some personal stuff, which is why it’s called Sorta SQL. It will be sort of about SQL most of the time.&lt;/p&gt;  &lt;p&gt;I live in Canberra, Australia, working with SQL and .Net.&lt;/p&gt;  &lt;p&gt;I hope to post some nice blog entries about SQL specific things like Reporting Services, Integration Service, SQL in general and the steep learning curve called Analysis Services. Wish me luck.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5472362728893389722-2033921034046518955?l=shaunbaggett.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SortaSql/~4/qR3ZXoVjqZ0" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SortaSql/~3/qR3ZXoVjqZ0/shauns-new-blog.html</link><author>noreply@blogger.com (Shaun Baggett)</author><thr:total>0</thr:total><feedburner:origLink>http://shaunbaggett.blogspot.com/2009/04/shauns-new-blog.html</feedburner:origLink></item></channel></rss>

