<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://sqlblog.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Search results matching tags 'SQL Server', 'SSDT', and 'SQL Server Data Tools'</title><link>http://sqlblog.com/search/SearchResults.aspx?o=DateDescending&amp;tag=SQL+Server,SSDT,SQL+Server+Data+Tools&amp;orTags=0</link><description>Search results matching tags 'SQL Server', 'SSDT', and 'SQL Server Data Tools'</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>Connected development in SSDT versus SSMS</title><link>http://sqlblog.com/blogs/jamie_thomson/archive/2013/03/19/connected-development-in-ssdt-versus-ssms.aspx</link><pubDate>Tue, 19 Mar 2013 16:28:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:48314</guid><dc:creator>jamiet</dc:creator><description>&lt;p&gt;When you install the database projects template of SSDT you get SQL Server Object Explorer (SSOX) installed as well. SSOX is a pane within Visual Studio and is the main enabler of the Connected Development experience that the SSDT team have attempted to provide.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://sqlblog.com/blogs/jamie_thomson/SNAGHTML15dc3f62_18DB391E.png"&gt;&lt;img title="SNAGHTML15dc3f62" style="border-top:0px;border-right:0px;border-bottom:0px;border-left:0px;display:inline;" border="0" alt="SNAGHTML15dc3f62" width="335" height="118" src="http://sqlblog.com/blogs/jamie_thomson/SNAGHTML15dc3f62_thumb_0C6D15F5.png"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;SSOX provides some really cool capabilities that are not in SQL Server Management Studio (I hope to blog about them in the near future). In theory these capabilities make it possible for a database developer to spend all their time in SSDT (i.e. Visual Studio) thus making SSMS a pureplay DBA tool (this does of course depend on your definition of both a database developer and a DBA, but I’m not getting into that debate here).&lt;/p&gt;  &lt;p&gt;With that in mind I have spent a few days trying to work without SSMS, preferring to live wholly inside Visual Studio instead. By and large I was able to do everything I needed to do from within Visual Studio however there were a few nuances about the experience that kept pushing me back to SSMS, I detail those nuances below.&lt;/p&gt;  &lt;p&gt;&amp;nbsp;&lt;/p&gt;  &lt;hr&gt;  &lt;h3&gt;Server groups&lt;/h3&gt;  &lt;p&gt;SSOX combines the functions of SSMS’s Object Explorer and Registered Servers pane. I don’t mind either way of working but it does mean that there is no ability to group servers in SSOX like you can in the Registered Servers pane&lt;/p&gt;  &lt;p&gt;&lt;a href="http://sqlblog.com/blogs/jamie_thomson/image_568820DA.png"&gt;&lt;img title="image" style="border-left-width:0px;border-right-width:0px;border-bottom-width:0px;display:inline;border-top-width:0px;" border="0" alt="image" width="244" height="97" src="http://sqlblog.com/blogs/jamie_thomson/image_thumb_4E907E78.png"&gt;&lt;/a&gt;&amp;nbsp;&lt;a href="http://sqlblog.com/blogs/jamie_thomson/image_0977B142.png"&gt;&lt;img title="image" style="border-left-width:0px;border-right-width:0px;border-bottom-width:0px;display:inline;border-top-width:0px;" border="0" alt="image" width="244" height="230" src="http://sqlblog.com/blogs/jamie_thomson/image_thumb_6C8E8C6C.png"&gt;&lt;/a&gt; &lt;/p&gt;  &lt;h3&gt;F6&lt;/h3&gt;  &lt;p&gt;In SSMS I regularly use the F6 keyboard shortcut to jump between the query, results &amp;amp; messages panes of a query window. No such keyboard shortcut exists in SSDT and they’ve already canned &lt;a target="_blank" href="https://connect.microsoft.com/sqlserver/feedback/details/780990/ssdt-f6-to-move-between-panes-in-a-query-window#tabs"&gt;my request on Connect to get this fixed&lt;/a&gt; (even though it laughably has status “closed as fixed”).&lt;/p&gt;  &lt;p&gt;&amp;nbsp;&lt;i&gt;UPDATE: See the comments below where Brett Gerhardi informed me of a different keyboard shortcut that does the same thing as F6. Actually its not quite the same, if you have multiple resultsets in your results pane then the behaviour is slightly different to F6 in SSMS - but that's not an issue you'll hot frequently.&lt;/i&gt;&lt;/p&gt;  &lt;h3&gt;Change Connection&lt;/h3&gt;  &lt;p&gt;The context menu in SSMS provides the ability to change a connection as well as connect and disconnect:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://sqlblog.com/blogs/jamie_thomson/image_72693005.png"&gt;&lt;img title="image" style="border-left-width:0px;border-right-width:0px;border-bottom-width:0px;display:inline;border-top-width:0px;" border="0" alt="image" width="546" height="115" src="http://sqlblog.com/blogs/jamie_thomson/image_thumb_11ABD6D9.png"&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;SSDT doesn’t have change connection and believe me, you don’t know how much you use a feature until its not there:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://sqlblog.com/blogs/jamie_thomson/image_09B43477.png"&gt;&lt;img title="image" style="border-left-width:0px;border-right-width:0px;border-bottom-width:0px;display:inline;border-top-width:0px;" border="0" alt="image" width="438" height="58" src="http://sqlblog.com/blogs/jamie_thomson/image_thumb_28F6DB4A.png"&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;There’s also no hotkey to jump to “Connection” on the context menu like there is in SSMS (“C”) and I find that annoying too.&lt;/p&gt;  &lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;hr&gt;Those were the main annoyances that forced me back to SSMS. The lack of F6 was a major bugbear for me as I am a big keyboard shortcut junkie. If such things don’t bother you then you may be able to live in Visual Studio quite happily. If you have any similar experiences to share I’d be keen to read them.&lt;p&gt;&amp;nbsp;&lt;/p&gt;  &lt;p&gt;&lt;a target="_blank" href="http://twitter.com/jamiet"&gt;@Jamiet&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Deployment of client-specific database code using SSDT</title><link>http://sqlblog.com/blogs/jamie_thomson/archive/2013/03/10/deployment-of-client-specific-database-code-using-ssdt.aspx</link><pubDate>Sun, 10 Mar 2013 13:24:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:48159</guid><dc:creator>jamiet</dc:creator><description>&lt;p&gt;Yesterday I attended &lt;a target="_blank" href="http://www.sqlsaturday.com/194/"&gt;SQL Saturday 194&lt;/a&gt; in Exeter for which many people deserve credit but especially the organisers &lt;a target="_blank" href="https://twitter.com/fatherjack"&gt;Jonathan Allen&lt;/a&gt; &amp;amp; &lt;a target="_blank" href="https://twitter.com/mrs_fatherjack"&gt;Annette Allen&lt;/a&gt; and the sponsors &lt;a target="_blank" href="http://www.fusionio.com/"&gt;Fusion-IO&lt;/a&gt;, &lt;a target="_blank" href="http://www.confio.com/"&gt;Confio Software&lt;/a&gt;, &lt;a target="_blank" href="http://www.nexusopensystems.co.uk/"&gt;Nexus&lt;/a&gt;, &lt;a target="_blank" href="http://www.bigbangdata.co.uk/Pages/default.aspx"&gt;Big Bang Data Company&lt;/a&gt;, &lt;a target="_blank" href="http://www.purplefrogsystems.com/"&gt;Purple Frog Systems&lt;/a&gt;, &lt;a target="_blank" href="http://www.red-gate.com/"&gt;Redgate&lt;/a&gt;, &lt;a target="_blank" href="http://www.idera.com/"&gt;idera&lt;/a&gt;, &lt;a target="_blank" href="http://pluralsight.com"&gt;Pluralsight&lt;/a&gt;, &lt;a target="_blank" href="http://exeterhotels.jurysinns.com/"&gt;Jurys Inn Exeter&lt;/a&gt; &amp;amp; &lt;a target="_blank" href="http://eu.wiley.com/"&gt;Wrox&lt;/a&gt;.&lt;/p&gt;  &lt;table cellspacing="0" cellpadding="2"&gt;     &lt;tr&gt;       &lt;td&gt;&lt;a href="http://sqlblog.com/blogs/jamie_thomson/image_072C63C9.png"&gt;&lt;img title="image" style="border-left-width:0px;border-right-width:0px;background-image:none;border-bottom-width:0px;padding-top:0px;padding-left:0px;display:inline;padding-right:0px;border-top-width:0px;" border="0" alt="image" width="327" height="238" src="http://sqlblog.com/blogs/jamie_thomson/image_thumb_312C61F1.png"&gt;&lt;/a&gt;&lt;/td&gt;        &lt;td&gt;&lt;a href="http://sqlblog.com/blogs/jamie_thomson/image_57221247.png"&gt;&lt;img title="image" style="border-left-width:0px;border-right-width:0px;background-image:none;border-bottom-width:0px;padding-top:0px;padding-left:0px;display:inline;padding-right:0px;border-top-width:0px;" border="0" alt="image" width="317" height="296" src="http://sqlblog.com/blogs/jamie_thomson/image_thumb_161392E3.png"&gt;&lt;/a&gt;&lt;/td&gt;     &lt;/tr&gt;   &lt;/table&gt;  &lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;hr&gt;I gave a talk entitled &lt;b&gt;Declarative Database Development with SSDT&lt;/b&gt;; both during the session and then afterwards on Twitter &lt;a target="_blank" href="https://twitter.com/leopasta"&gt;Leo Pasta&lt;/a&gt; asked me&lt;p&gt;&amp;nbsp;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a target="_blank" href="https://twitter.com/leopasta/status/310680898049826816"&gt;&lt;img title="image" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;display:inline;padding-right:0px;" border="0" alt="image" width="519" height="281" src="http://sqlblog.com/blogs/jamie_thomson/image_5505137E.png"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;&lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;i&gt;&lt;a target="_blank" href="https://twitter.com/leopasta/status/310680898049826816"&gt;would you have any extra references on how to handle client-specific changes to the DB schema&lt;/a&gt;&lt;/i&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;I promised Leo an answer, hence this blog post.&lt;/p&gt;  &lt;p&gt;If I understand Leo’s question correctly he has an application that is used by multiple clients, he has a separate instance of the application for every client, and the database requires client-specific customisations; luckily for Leo there is a new feature in SSDT that is perfect for this situation. First let’s set up our solution in SSDT:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://sqlblog.com/blogs/jamie_thomson/image_45EE34A4.png"&gt;&lt;img title="image" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;display:inline;padding-right:0px;" border="0" alt="image" width="359" height="284" src="http://sqlblog.com/blogs/jamie_thomson/image_thumb_52E814B5.png"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;We have three database projects:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;_core - This contains all the objects that are common to all clients. For demonstration purposes it simply contains a table called [Sales]&lt;/li&gt;    &lt;li&gt;clientFoo – All the objects that are required only by client “Foo”. In this case there is view which aggregates the data in [Sales] by Customer&lt;/li&gt;    &lt;ul&gt;&lt;/ul&gt;    &lt;li&gt;clientBar – All the objects that are required only by client “Bar”. In this case there is view which aggregates the data in [Sales] by Location&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;In order that the reference to table [Sales] in the two views can be resolved both of the client-specific projects have a database reference to _core:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://sqlblog.com/blogs/jamie_thomson/image_38A7AB91.png"&gt;&lt;img title="image" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;margin:0px;border-left:0px;display:inline;padding-right:0px;" border="0" alt="image" width="242" height="244" src="http://sqlblog.com/blogs/jamie_thomson/image_thumb_09E1F2EF.png"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;It is those database references that allows objects in clientFoo/clientBar to refer to objects in _core. Now here’s the important bit. When we set up those two database references &lt;b&gt;we must specify that the objects in the referenced project are intended to be in the same database&lt;/b&gt;:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://sqlblog.com/blogs/jamie_thomson/SNAGHTMLa9aab43_48D3738A.png"&gt;&lt;img title="SNAGHTMLa9aab43" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;display:inline;padding-right:0px;" border="0" alt="SNAGHTMLa9aab43" width="643" height="525" src="http://sqlblog.com/blogs/jamie_thomson/SNAGHTMLa9aab43_thumb_4722A7B6.png"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Having objects from one database split over multiple projects is called &lt;b&gt;composite projects&lt;/b&gt;. The effect of this is that (by default) whenever clientFoo or clientBar are deployed &lt;b&gt;the objects in _core will get deployed as well&lt;/b&gt;. We can see this in the output when we deploy clientFoo:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://sqlblog.com/blogs/jamie_thomson/image_5ACF914A.png"&gt;&lt;img title="image" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;display:inline;padding-right:0px;" border="0" alt="image" width="561" height="166" src="http://sqlblog.com/blogs/jamie_thomson/image_thumb_59F72B60.png"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Notice how &lt;b&gt;even though we chose not to deploy _core&lt;/b&gt; two objects have been created; table [Sales] (from the _core project) and view [vSalesPerCustomer]. This is the new feature in SSDT that I spoke of above – a deployment of a project will (by default) also deploy all the objects in referenced projects where objects in the referenced database are intended to be in the same database (incidentally this functionality replaces the “partial projects” feature from previous incarnations of SSDT).&lt;/p&gt;  &lt;p&gt;Note that you can change this default behaviour in the advanced publish settings by unchecking the “Include composite objects” box:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://sqlblog.com/blogs/jamie_thomson/SNAGHTMLaac90d1_5CBCE053.png"&gt;&lt;img title="SNAGHTMLaac90d1" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;display:inline;padding-right:0px;" border="0" alt="SNAGHTMLaac90d1" width="422" height="612" src="http://sqlblog.com/blogs/jamie_thomson/SNAGHTMLaac90d1_thumb_61BF1E02.png"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Hence, with the “Include Composite Objects” setting turned on, we can deploy both projects clientFoo &amp;amp; clientBar and both will contain table [Sales] plus their own client-specific view:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://sqlblog.com/blogs/jamie_thomson/image_2E16B1A4.png"&gt;&lt;img title="image" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;display:inline;padding-right:0px;" border="0" alt="image" width="394" height="628" src="http://sqlblog.com/blogs/jamie_thomson/image_thumb_3F1ADF87.png"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;which (I hope) is exactly what Leo was after!&lt;/p&gt;  &lt;p&gt;That’s all there is to it. A very very nice new feature of SSDT!&lt;/p&gt;  &lt;p&gt;&lt;a target="_blank" href="http://twitter.com/jamiet"&gt;@Jamiet&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Which version of SSDT Database Projects do I have installed?</title><link>http://sqlblog.com/blogs/jamie_thomson/archive/2013/02/08/which-version-of-ssdt-database-projects-do-i-have-installed.aspx</link><pubDate>Fri, 08 Feb 2013 21:15:52 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:47608</guid><dc:creator>jamiet</dc:creator><description>&lt;p&gt;SQL Server Data Tools (SSDT) is released on a very regular cadence (note that I’m talking about the &lt;a href="http://sqlblog.com/blogs/jamie_thomson/archive/2012/04/03/ssdt-what-s-in-a-name.aspx" target="_blank"&gt;database projects part of SSDT&lt;/a&gt;, this is nothing to do with SSIS/SSAS/SSRS). Since the first release in &lt;a href="http://blogs.msdn.com/b/ssdt/archive/2012/03/05/available-today-sql-server-data-tools-rtw.aspx" target="_blank"&gt;March 2012&lt;/a&gt; there have been releases in &lt;a href="http://blogs.msdn.com/b/ssdt/archive/2012/09/14/now-available-sql-server-data-tools-september-2012-update.aspx" target="_blank"&gt;September 2012&lt;/a&gt;, &lt;a href="http://blogs.msdn.com/b/ssdt/archive/2012/11/07/sql-server-data-tools-november-2012-is-now-available.aspx" target="_blank"&gt;November 2012&lt;/a&gt;, &amp;amp; &lt;a href="http://blogs.msdn.com/b/ssdt/archive/2012/12/13/available-today-ssdt-december-2012.aspx" target="_blank"&gt;December 2012&lt;/a&gt;. I personally have found it difficult to keep track of not only which particular version I am using but also that which are my colleagues are using – quite simply I didn’t know how to discover the current version number. I assumed that the answer would lie within Visual Studio 2012 in the Help-&amp;gt;About Microsoft Visual Studio menu option, when I checked there I saw this:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://sqlblog.com/blogs/jamie_thomson/SNAGHTML339e96a2_1BDE30CA.png"&gt;&lt;img title="SNAGHTML339e96a2" style="border-left-width:0px;border-right-width:0px;background-image:none;border-bottom-width:0px;padding-top:0px;padding-left:0px;display:inline;padding-right:0px;border-top-width:0px;" border="0" alt="SNAGHTML339e96a2" src="http://sqlblog.com/blogs/jamie_thomson/SNAGHTML339e96a2_thumb_286BDDE6.png" width="507" height="333" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;A version number – 11.1.21208.0. What does that mean though? To understand more we have to go to Add/Remove programs:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://sqlblog.com/blogs/jamie_thomson/SNAGHTML42d8efe8_2008088F.png"&gt;&lt;img title="SNAGHTML42d8efe8" style="border-left-width:0px;border-right-width:0px;background-image:none;border-bottom-width:0px;padding-top:0px;padding-left:0px;display:inline;padding-right:0px;border-top-width:0px;" border="0" alt="SNAGHTML42d8efe8" src="http://sqlblog.com/blogs/jamie_thomson/SNAGHTML42d8efe8_thumb_528B6601.png" width="934" height="275" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;There are many different items listed there, let’s look at them in turn:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;strong&gt;Microsoft SQL Server 2012 Data-Tier App Framework&lt;/strong&gt;. This is fairly self-explanatory if you know what the Data-Tier App Framework (aka DACFx) is. If you don’t, see the notes at the end of this blog post*. The reason that you see two entries in the list above is due to my having the 32bit &amp;amp; 64bit versions installed – the fact that there is no differentiation between the two in the title is a bug. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Microsoft SQL Server 2012 Express LocalDB&lt;/strong&gt;. LocalDB is the small server-less version of SQL Server that now gets deployed with SQL Server proper. LocalDB also gets installed with SSDT if you do not already have it, but you should consider it part of SQL Server itself. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Microsoft SQL Server Data Tools 2010&lt;/strong&gt;. This was described to me as the “installation chainer” – it is the installation component that manages SSDT and its dependencies. I think of it as the SSDT shell within Visual Studio 2010. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Microsoft SQL Server Data Tools 2012&lt;/strong&gt;. This was described to me as the “installation chainer” – it is the installation component that manages SSDT and its dependencies. I think of it as the SSDT shell within Visual Studio 2012. Note that the version number is the same as in the Help-&amp;gt;About screenshot at the top of this article – that is because they are one and the same. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Microsoft SQL Server Data Tools – Database Projects – Web installer entry point&lt;/strong&gt;. A stub project that gets installed when you install SQL Server. Its the SSDT database project entry point. &lt;/li&gt;    &lt;li&gt;&lt;font size="2"&gt;&lt;u&gt;&lt;strong&gt;Microsoft SQL Server Data Tools – enu (10.3.21208.0)&lt;/strong&gt; &amp;amp; &lt;strong&gt;Microsoft SQL Server Data Tools – enu (11.1.21208.0)&lt;/strong&gt;. These are the things we’re interested in. These *are* SSDT database projects, for Visual Studio 2010 &amp;amp; Visual Studio 2012 respectively. The version numbers are those for the December 2012 release; note that the build numbers are the same (X.X.21208.X), only the major and minor numbers are different.&lt;/u&gt;&lt;/font&gt; &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Microsoft SQL Server Data Tools Build Utilities – enu (10.3.21208.0)&lt;/strong&gt; &amp;amp; &lt;strong&gt;Microsoft SQL Server Data Tools Build Utilities – enu (11.1.21208.0)&lt;/strong&gt;. Everything you need to do a headless (i.e. without having Visual Studio installed) build/deploy of an SSDT database project. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;So at the end of all that we have determined the following version numbers for SSDT database projects are:&lt;/p&gt;  &lt;table cellspacing="0" cellpadding="2"&gt;     &lt;tr&gt;       &lt;td&gt;         &lt;p align="center"&gt;&lt;strong&gt;Release&lt;/strong&gt;&lt;/p&gt;       &lt;/td&gt;        &lt;td&gt;&amp;nbsp;&lt;/td&gt;        &lt;td&gt;         &lt;p align="center"&gt;&lt;strong&gt;Visual Studio 2010 version number&lt;/strong&gt;&lt;/p&gt;       &lt;/td&gt;        &lt;td&gt;&amp;nbsp;&lt;/td&gt;        &lt;td&gt;         &lt;p align="center"&gt;&lt;strong&gt;Visual Studio 2012 version number&lt;/strong&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;         &lt;p align="center"&gt;September 2012&lt;/p&gt;       &lt;/td&gt;        &lt;td&gt;&amp;nbsp;&lt;/td&gt;        &lt;td&gt;         &lt;p align="center"&gt;10.3.20905.0&lt;/p&gt;       &lt;/td&gt;        &lt;td&gt;&amp;nbsp;&lt;/td&gt;        &lt;td&gt;         &lt;p align="center"&gt;11.1.20905.0&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;         &lt;p align="center"&gt;November 2012&lt;/p&gt;       &lt;/td&gt;        &lt;td&gt;&amp;nbsp;&lt;/td&gt;        &lt;td&gt;         &lt;p align="center"&gt;10.3.21101.1&lt;/p&gt;       &lt;/td&gt;        &lt;td&gt;&amp;nbsp;&lt;/td&gt;        &lt;td&gt;         &lt;p align="center"&gt;11.1.21101.1&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;         &lt;p align="center"&gt;December 2012&lt;/p&gt;       &lt;/td&gt;        &lt;td&gt;&amp;nbsp;&lt;/td&gt;        &lt;td&gt;         &lt;p align="center"&gt;10.3.21208.0&lt;/p&gt;       &lt;/td&gt;        &lt;td&gt;&amp;nbsp;&lt;/td&gt;        &lt;td&gt;         &lt;p align="center"&gt;11.1.21208.0&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/table&gt;  &lt;p&gt;&lt;strike&gt;I do not know the version numbers for the March 2012, September 2012 &amp;amp; November 2012 releases (if anyone out there does know please let me know in the comments) however I shall update this blog post for future releases.&lt;/strike&gt; September 2012 and November 2012 releases now added!&lt;/p&gt;  &lt;p&gt;I have requested that any blog post to announce future releases should contain the version numbers. Let’s hope that happens.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://twitter.com/jamiet" target="_blank"&gt;@Jamiet&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;* DACFx is described &lt;a href="http://www.microsoft.com/en-gb/download/details.aspx?id=35756" target="_blank"&gt;here&lt;/a&gt; as:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;The Microsoft® SQL Server® 2012 Data-Tier Application Framework (DACFx) is a component which provides application lifecycle services for database development and management for Microsoft® SQL Server® and Windows Azure SQL Databases.      &lt;br /&gt;DacFX supports various database deployment and management scenarios for SQL Server and Windows Azure SQL Databases including extracting/exporting a live database to a DAC package, deploying a DAC package to a new or existing database, and migrating from on-premise SQL Server to Windows Azure. This functionality is exposed via the DACFx managed API. DACFx can target SQL Server 2005 SP4, 2008 SP1, 2008R2, 2012, and Windows Azure SQL Databases. DACFx also provides the command-line utility SqlPackage.exe for creating and deploying .dacpac and .bacpac packages. DACFx supports scenarios provided by SQL Server client tooling including SQL Server Data Tools and SQL Server Management Studio 2012.&lt;/p&gt;&lt;/blockquote&gt;</description></item><item><title>Responses to SSDT questions</title><link>http://sqlblog.com/blogs/jamie_thomson/archive/2013/01/11/responses-to-ssdt-questions.aspx</link><pubDate>Fri, 11 Jan 2013 22:22:24 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:47124</guid><dc:creator>jamiet</dc:creator><description>&lt;p&gt;My recent article &lt;a href="http://www.devproconnections.com/article/sql-server-2012/sql-server-2012-data-tools-144829"&gt;Get to Know SQL Server 2012's SQL Server Data Tools&lt;/a&gt; prompted two questions to come to me via email and in the interests of sharing knowledge via search engines I thought I would answer them here rather than by simply replying by email (I hate that so much useful information gets trapped inside closed inboxes).&lt;/p&gt;  &lt;hr /&gt;  &lt;p&gt;&lt;em&gt;&lt;font color="#c0504d"&gt;Question: How would you handle cases below, our main database has many objects already, we are using redgate source control to keep things under sourcecontrol but ssdt would be awesome.        &lt;br /&gt;Our database has some invalid stored procs etc, unfortunately we do not want to drop them, underlying objects either don't exists or has changed etc         &lt;br /&gt;There are linked servers or code referencing other objects stored in the database         &lt;br /&gt;There are staging table named automatically in the database and we do not want to include them in the project and not drop them or touch them in a deploy &lt;/font&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;JT: The overall question here seems to be “how do we prevent SSDT from DROPping sprocs and staging tables that are in the target database but are not in the SSDT project?” Fortunately SSDT has an option within it to allow exactly what the questioner requires. When an SSDT project is published one has the option to set some properties relating to that publish. One of the settings is “DROP objects in target but not in project”:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://sqlblog.com/blogs/jamie_thomson/SNAGHTML5751f10_20688721.png"&gt;&lt;img title="SNAGHTML5751f10" style="border-left-width:0px;border-right-width:0px;background-image:none;border-bottom-width:0px;padding-top:0px;padding-left:0px;display:inline;padding-right:0px;border-top-width:0px;" border="0" alt="SNAGHTML5751f10" src="http://sqlblog.com/blogs/jamie_thomson/SNAGHTML5751f10_thumb_11A9A170.png" width="340" height="484" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;If that option is left unchecked (which is the default) then no objects will get removed from the target database.&lt;/p&gt;  &lt;hr /&gt;  &lt;p&gt;&lt;em&gt;&lt;font color="#c0504d"&gt;Question: At my previous shop, I done a proof of concept with one of our databases, but never got it implemented as VS2012 (with SSDT) had not been released yet. Well, fast forward 9 or so months, and at my new shop (which is extremely agile) I've been tasked with setting up our db projects with SSDT so for the immediate short term goals/objectives we can;&lt;/font&gt;&lt;/em&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;em&gt;&lt;font color="#c0504d"&gt;Allow new or existing developers to be able to easily get the latest databases from source control downloaded from TFS, built and deployed onto our local sandbox db environments. This ideally will be done via a powershell script or something of the sort. &lt;/font&gt;&lt;/em&gt;&lt;/li&gt;    &lt;li&gt;&lt;font color="#c0504d"&gt;&lt;em&gt;Be able to employ C.I. so that every night a database deployment is done to our system test servers.&lt;/em&gt; &lt;/font&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;em&gt;&lt;font color="#c0504d"&gt;3 days into it, and I've wrestled with 3 of our databases, reverse engineering them into TFS and getting them built etc. My question is, what are the best practices or guidelines for;&lt;/font&gt;&lt;/em&gt;&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;&lt;em&gt;&lt;font color="#c0504d"&gt;Allowing only Windows authentication for the local deploys to the sandbox environment. i.e. is it best to have a script with all our team user logins in a script? How would the project recognise a team member which will create a login for them so once the project is deployed they can login to their local db? &lt;/font&gt;&lt;/em&gt;&lt;/li&gt;    &lt;li&gt;&lt;em&gt;&lt;font color="#c0504d"&gt;Using a 1-touch/click action (preferably outside of VS2010) to get latest, build project &amp;amp; deploy to local sandbox &lt;/font&gt;&lt;/em&gt;&lt;/li&gt;    &lt;li&gt;&lt;em&gt;&lt;font color="#c0504d"&gt;Same as above but to a system test server&lt;/font&gt;&lt;/em&gt; &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;JT: There are quite a few questions there. Firstly I’ll say that its great to hear of sandboxed environments and Continuous Integration (CI) being used – I openly advocate these techniques in my blog post &lt;a href="http://sqlblog.com/blogs/jamie_thomson/archive/2012/01/01/implementing-sql-server-solutions-using-visual-studio-2010-database-projects-a-compendium-of-project-experiences.aspx"&gt;Implementing SQL Server solutions using Visual Studio 2010 Database Projects – a compendium of project experiences&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Now, taking each question in turn:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Windows Auth for local deploys. I’m not sure if there’s any recognised best practise here but if developers are working on local sandboxes I would assume they would have sysadmin rights so I’m not sure there’s a need to have a script of team logins. Perhaps I have misunderstood the question in which case please clarify in the comments below. I will say this though – I think its better to have a Windows group that you can move all of your devs in and out of rather than having to modify a script each time a user joins your team. &lt;/li&gt;    &lt;li&gt;1-click get latest, build &amp;amp; deploy. Scripting your build &amp;amp; deploy is something else I advocate in the &lt;a href="http://sqlblog.com/blogs/jamie_thomson/archive/2012/01/01/implementing-sql-server-solutions-using-visual-studio-2010-database-projects-a-compendium-of-project-experiences.aspx"&gt;aforementioned blog post&lt;/a&gt;:       &lt;blockquote&gt;       &lt;p&gt;&lt;em&gt;Building and deploying your datadude projects within Visual Studio can become a real time hog; in my experience its not unusual for deployments to take many minutes and your Visual Studio environment will be unavailable for further development work during that time. For that reason I recommend investing some time in writing some msbuild scripts that will build and deploy your project(s) from the command-line.&lt;/em&gt;&lt;/p&gt;     &lt;/blockquote&gt;      &lt;p&gt;I’ll go further here and say that the script with which you use to build and deploy to your sandbox should be the same script as which you use for your production environment and everything in between. The script should take a parameter value to name the environment and then deploy appropriately.&lt;/p&gt;   &lt;/li&gt;    &lt;li&gt;See 2. &lt;/li&gt; &lt;/ol&gt;    &lt;hr /&gt;Hope that is useful. Any questions? Please put them in the comments.    &lt;p&gt;&lt;a href="http://twitter.com/jamiet" target="_blank"&gt;@Jamiet&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Get to Know SQL Server 2012's SQL Server Data Tools [article published]</title><link>http://sqlblog.com/blogs/jamie_thomson/archive/2013/01/09/get-to-know-sql-server-2012-s-sql-server-data-tools-article-published.aspx</link><pubDate>Wed, 09 Jan 2013 23:12:03 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:47093</guid><dc:creator>jamiet</dc:creator><description>&lt;p&gt;I recently wrote an article on SQL Server Data Tools for SQL Server Magazine and it has now been published online at &lt;a href="http://www.devproconnections.com/article/sql-server-2012/sql-server-2012-data-tools-144829" target="_blank"&gt;Get to Know SQL Server 2012's SQL Server Data Tools&lt;/a&gt;. In the article I offer my thoughts and opinions on SQL Server Data Tools as it exists in SQL Server 2012.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://www.devproconnections.com/article/sql-server-2012/sql-server-2012-data-tools-144829"&gt;&lt;img title="image" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;display:inline;padding-right:0px;" border="0" alt="image" src="http://sqlblog.com/blogs/jamie_thomson/image_54C3565A.png" width="558" height="231" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Note that the article refers to SSDT database projects only, there is nothing in there pertaining to SSIS, SSAS or SSRS. If you find that confusing then you should probably go and at least read the first few paragraphs of the article where I try to alleviate some of that confusion.&lt;/p&gt;  &lt;p&gt;Constructive feedback is, as always, very welcome.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://twitter.com/jamiet" target="_blank"&gt;@Jamiet&lt;/a&gt;&lt;/p&gt;</description></item><item><title>New version of SQL Server Data Tools is now available</title><link>http://sqlblog.com/blogs/jamie_thomson/archive/2012/09/16/new-version-of-sql-server-data-tools-is-now-available.aspx</link><pubDate>Sun, 16 Sep 2012 22:03:45 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:45224</guid><dc:creator>jamiet</dc:creator><description>&lt;p&gt;If you don’t follow the &lt;a href="http://blogs.msdn.com/b/ssdt/" target="_blank"&gt;SQL Server Data Tools (SSDT) blog&lt;/a&gt; then you may not know that two days ago an updated version of SSDT was released (&lt;a href="http://sqlblog.com/blogs/jamie_thomson/archive/2012/04/03/ssdt-what-s-in-a-name.aspx" target="_blank"&gt;and by SSDT I mean the database projects, not the SSIS/SSRS/SSAS stuff&lt;/a&gt;) along with a new version of the SSDT Power Tools. This release incorporates a an updated version of the SQL Server Data Tier Application Framework (aka DAC Framework, aka DacFX) which you can read about on Adam Mahood’s blog post &lt;a href="http://blogs.msdn.com/b/ssdt/archive/2012/09/11/sql-server-data-tier-application-framework-september-2012-available.aspx" target="_blank"&gt;SQL Server Data-Tier Application Framework (September 2012) Available&lt;/a&gt;. DacFX is essentially all the gubbins that you need to extract and publish .dacpacs and according to Adam’s post it incorporates a new feature that I think is very interesting indeed:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Extract DACPAC with data – Creates a database snapshot file (.dacpac) from a live SQL Server or Windows Azure SQL Database that contains data from user tables in addition to the database schema. These packages can be published to a new or existing SQL Server or Windows Azure SQL Database using the SqlPackage.exe Publish action. Data contained in package replaces the existing data in the target database.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;In short, .dacpacs can now include data as well as schema. I’m very excited about this because one of my long-standing complaints about SSDT (and its many forebears) is that whilst it has great support for declarative development of schema it does not provide anything similar for data – if you want to deploy data from your SSDT projects then you have to write Post-Deployment MERGE scripts. This new feature for .dacpacs does not change that situation yet however it is a very important pre-requisite so I am hoping that a feature to provide declaration of data (in addition to declaration of schema which we have today) is going to light up in SSDT in the not too distant future.&lt;/p&gt;  &lt;p&gt;Read more about the latest SSDT, Power Tools &amp;amp; DacFX releases at:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://blogs.msdn.com/b/ssdt/archive/2012/09/14/now-available-sql-server-data-tools-september-2012-update.aspx" target="_blank"&gt;Now available: SQL Server Data Tools - September 2012 update!&lt;/a&gt; by &lt;a href="http://social.msdn.microsoft.com/profile/janet%20yeilding/" target="_blank"&gt;Janet Yeilding&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/b/ssdt/archive/2012/09/14/new-ssdt-power-tools-now-for-both-visual-studio-2010-and-visual-studio-2012.aspx" target="_blank"&gt;New SSDT Power Tools! Now for both Visual Studio 2010 and Visual Studio 2012&lt;/a&gt; by &lt;a href="http://social.msdn.microsoft.com/profile/sarahmcd/" target="_blank"&gt;Sarah McDevitt&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/b/ssdt/archive/2012/09/11/sql-server-data-tier-application-framework-september-2012-available.aspx" target="_blank"&gt;SQL Server Data-Tier Application Framework (September 2012) Available&lt;/a&gt; by &lt;a href="http://social.msdn.microsoft.com/profile/adam%20mahood%20%5Bmsft%5D/" target="_blank"&gt;Adam Mahood&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;a href="http://twitter.com/jamiet" target="_blank"&gt;@Jamiet&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Bitmask data insertions in SSDT Post-Deployment scripts</title><link>http://sqlblog.com/blogs/jamie_thomson/archive/2012/06/11/bitmask-data-insertions-in-ssdt-post-deployment-scripts.aspx</link><pubDate>Mon, 11 Jun 2012 10:11:23 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:43825</guid><dc:creator>jamiet</dc:creator><description>&lt;p&gt;On my current project we are using SQL Server Data Tools (SSDT) to manage our database schema and one of the tasks we need to do often is insert data into that schema once deployed; the typical method employed to do this is to leverage Post-Deployment scripts and that is exactly what we are doing.&lt;/p&gt;  &lt;p&gt;Our requirement is a little different though, our data is split up into various buckets that we need to selectively deploy on a case-by-case basis. I was going to use a SQLCMD variable for each bucket (defaulted to some value other than “Yes”) to define whether it should be deployed or not so we could use something like this in our Post-Deployment script:&lt;/p&gt;  &lt;blockquote&gt;   &lt;pre style="font-size:12px;"&gt;&lt;font color="blue"&gt;IF &lt;/font&gt;&lt;font color="gray"&gt;(&lt;/font&gt;&lt;font color="black"&gt;$&lt;/font&gt;&lt;font color="gray"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;DeployBucket1Flag&lt;/font&gt;&lt;font color="gray"&gt;) &lt;/font&gt;&lt;font color="blue"&gt;= &lt;/font&gt;&lt;font color="red"&gt;'Yes'&lt;/font&gt;&lt;font color="gray"&gt;)&lt;br /&gt;&lt;/font&gt;&lt;font color="blue"&gt;BEGIN&lt;br /&gt;&lt;/font&gt;&lt;font color="#000000"&gt;&amp;#160;&amp;#160; :r .\Bucket1.data.sql&lt;/font&gt;&lt;font color="black"&gt;&lt;br /&gt;&lt;/font&gt;&lt;font color="blue"&gt;END&lt;/font&gt;&lt;br /&gt;&lt;font color="blue"&gt;IF &lt;/font&gt;&lt;font color="gray"&gt;(&lt;/font&gt;&lt;font color="black"&gt;$&lt;/font&gt;&lt;font color="gray"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;DeployBucket2Flag&lt;/font&gt;&lt;font color="gray"&gt;) &lt;/font&gt;&lt;font color="blue"&gt;= &lt;/font&gt;&lt;font color="red"&gt;'Yes'&lt;/font&gt;&lt;font color="gray"&gt;)&lt;br /&gt;&lt;/font&gt;&lt;font color="blue"&gt;BEGIN&lt;br /&gt;&lt;/font&gt;&lt;font color="#000000"&gt;&amp;#160;&amp;#160; :r .\Bucket2.data.sql&lt;/font&gt;&lt;font color="black"&gt;&lt;br /&gt;&lt;/font&gt;&lt;font color="blue"&gt;END&lt;/font&gt;&lt;br /&gt;&lt;font color="blue"&gt;IF &lt;/font&gt;&lt;font color="gray"&gt;(&lt;/font&gt;&lt;font color="black"&gt;$&lt;/font&gt;&lt;font color="gray"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;DeployBucket3Flag&lt;/font&gt;&lt;font color="gray"&gt;) &lt;/font&gt;&lt;font color="blue"&gt;= &lt;/font&gt;&lt;font color="red"&gt;'Yes'&lt;/font&gt;&lt;font color="gray"&gt;)&lt;br /&gt;&lt;/font&gt;&lt;font color="blue"&gt;BEGIN&lt;br /&gt;&lt;/font&gt;&lt;font color="#000000"&gt;&amp;#160;&amp;#160; :r .\Bucket3.data.sql&lt;/font&gt;&lt;font color="black"&gt;&lt;br /&gt;&lt;/font&gt;&lt;font color="blue"&gt;END&lt;/font&gt;&lt;br /&gt;&lt;/pre&gt;
&lt;/blockquote&gt;

&lt;p&gt;That works fine and is, I’m sure, a very common technique for doing this. It is however slightly ugly because we have to litter our deployment with various SQLCMD variables. My colleague James Rowland-Jones (&lt;a href="http://www.sqlpass.org/AboutPASS/JamesRowlandJones.aspx" target="_blank"&gt;whom I’m sure&lt;/a&gt; &lt;a href="http://sqlbits.com/(X(1)S(rvhw4svwhvv403unuasmdl45))/about/WhosWho.aspx" target="_blank"&gt;many of you know&lt;/a&gt;) suggested another technique – bitmasks. I won’t go into detail about how this works (James has already done that at &lt;a href="http://consultingblogs.emc.com/jamesrowlandjones/archive/2008/07/04/using-a-bitmask-a-practical-example.aspx" target="_blank"&gt;Using a Bitmask - a practical example&lt;/a&gt;) but I’ll summarise by saying that you can deploy different combinations of the buckets simply by supplying a different numerical value for a single SQLCMD variable. Each bit of that value’s binary representation signifies whether a particular bucket should be deployed or not. This is better demonstrated using the following simple script (which can be easily leveraged inside your Post-Deployment scripts):&lt;/p&gt;

&lt;blockquote&gt;
  &lt;pre style="text-align:left;list-style-type:disc;font-family:;background:white;color:;"&gt;&lt;font face="Consolas"&gt;&lt;span style="color:;"&gt;&lt;font color="#008000"&gt;&lt;font style="font-size:9.8pt;"&gt;/* $(DeployData) is a SQLCMD variable that would, if you were using this in SSDT, be declared in the SQLCMD variables section of your &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:9.8pt;"&gt;
&lt;span style="color:;"&gt;&lt;font color="#008000"&gt;project file. It should contain a numerical value, defaulted to 0.&lt;/font&gt;&lt;/span&gt;
 
&lt;span style="color:;"&gt;&lt;font color="#008000"&gt;In this example I have declared it using a :setvar statement. Test the affect of different values&lt;/font&gt;&lt;/span&gt;
&lt;span style="color:;"&gt;&lt;font color="#008000"&gt;by changing the :setvar statement accordingly.&lt;/font&gt;&lt;/span&gt;
 
&lt;span style="color:;"&gt;&lt;font color="#008000"&gt;Examples:&lt;/font&gt;&lt;/span&gt;
&lt;span style="color:;"&gt;&lt;font color="#008000"&gt;:setvar DeployData 1   &lt;span style="color:;"&gt;&lt;font color="#008000"&gt;will deploy bucket 1&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;
&lt;span style="color:;"&gt;&lt;font color="#008000"&gt;:setvar DeployData 2   &lt;span style="color:;"&gt;&lt;font color="#008000"&gt;will deploy bucket 2&lt;/font&gt;&lt;/span&gt; &lt;/font&gt;&lt;/span&gt;
&lt;span style="color:;"&gt;&lt;font color="#008000"&gt;:setvar DeployData 3&amp;#160;&amp;#160; will deploy buckets 1 &amp;amp; 2&lt;/font&gt;&lt;/span&gt;
&lt;span style="color:;"&gt;&lt;font color="#008000"&gt;:setvar DeployData 6&amp;#160;&amp;#160; will deploy buckets 2 &amp;amp; 3&lt;/font&gt;&lt;/span&gt;
&lt;span style="color:;"&gt;&lt;font color="#008000"&gt;:setvar DeployData 31&amp;#160; will deploy buckets 1, 2, 3, 4 &amp;amp; 5&lt;/font&gt;&lt;/span&gt;
&lt;span style="color:;"&gt;&lt;font color="#008000"&gt;*/&lt;/font&gt;&lt;/span&gt;
&lt;font style="background-color:#cccccc;"&gt;&lt;span style="color:;"&gt;&lt;font color="#808080"&gt;:&lt;/font&gt;&lt;/span&gt;setvar DeployData 0&lt;/font&gt;
&lt;span style="color:;"&gt;&lt;font color="#0000ff"&gt;DECLARE&lt;/font&gt;&lt;/span&gt;&amp;#160; @bitmask &lt;span style="color:;"&gt;&lt;font color="#0000ff"&gt;VARBINARY&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff00ff"&gt;MAX&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/span&gt;&amp;#160;&lt;span style="color:;"&gt;&lt;font color="#808080"&gt;=&lt;/font&gt;&lt;/span&gt;&amp;#160;&lt;span style="color:;"&gt;&lt;font color="#ff00ff"&gt;CONVERT&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000ff"&gt;VARBINARY&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#808080"&gt;,&lt;/font&gt;&lt;/span&gt;$&lt;span style="color:;"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/span&gt;DeployData&lt;span style="color:;"&gt;&lt;font color="#808080"&gt;));&lt;/font&gt;&lt;/span&gt;
&lt;span style="color:;"&gt;&lt;font color="#0000ff"&gt;IF &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/span&gt;@bitmask &lt;span style="color:;"&gt;&lt;font color="#808080"&gt;&amp;amp;&lt;/font&gt;&lt;/span&gt; 1 &lt;span style="color:;"&gt;&lt;font color="#808080"&gt;=&lt;/font&gt;&lt;/span&gt; 1&lt;span style="color:;"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/span&gt;
&lt;span style="color:;"&gt;&lt;font color="#0000ff"&gt;BEGIN&lt;/font&gt;&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000ff"&gt;PRINT&lt;/font&gt;&lt;/span&gt;&amp;#160;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;'Bucket 1 insertions'&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#808080"&gt;;&lt;/font&gt;&lt;/span&gt;
&lt;span style="color:;"&gt;&lt;font color="#0000ff"&gt;END&lt;/font&gt;&lt;/span&gt;
&lt;span style="color:;"&gt;&lt;font color="#0000ff"&gt;IF &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/span&gt;@bitmask &lt;span style="color:;"&gt;&lt;font color="#808080"&gt;&amp;amp;&lt;/font&gt;&lt;/span&gt; 2 &lt;span style="color:;"&gt;&lt;font color="#808080"&gt;=&lt;/font&gt;&lt;/span&gt; 2&lt;span style="color:;"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/span&gt;
&lt;span style="color:;"&gt;&lt;font color="#0000ff"&gt;BEGIN&lt;/font&gt;&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000ff"&gt;PRINT&lt;/font&gt;&lt;/span&gt;&amp;#160;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;'Bucket 2 insertions'&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#808080"&gt;;&lt;/font&gt;&lt;/span&gt;
&lt;span style="color:;"&gt;&lt;font color="#0000ff"&gt;END&lt;/font&gt;&lt;/span&gt;
&lt;span style="color:;"&gt;&lt;font color="#0000ff"&gt;IF &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/span&gt;@bitmask &lt;span style="color:;"&gt;&lt;font color="#808080"&gt;&amp;amp;&lt;/font&gt;&lt;/span&gt; 4 &lt;span style="color:;"&gt;&lt;font color="#808080"&gt;=&lt;/font&gt;&lt;/span&gt; 4&lt;span style="color:;"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/span&gt;
&lt;span style="color:;"&gt;&lt;font color="#0000ff"&gt;BEGIN&lt;/font&gt;&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000ff"&gt;PRINT&lt;/font&gt;&lt;/span&gt;&amp;#160;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;'Bucket 3 insertions'&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#808080"&gt;;&lt;/font&gt;&lt;/span&gt;
&lt;span style="color:;"&gt;&lt;font color="#0000ff"&gt;END&lt;/font&gt;&lt;/span&gt;
&lt;span style="color:;"&gt;&lt;font color="#0000ff"&gt;IF &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/span&gt;@bitmask &lt;span style="color:;"&gt;&lt;font color="#808080"&gt;&amp;amp;&lt;/font&gt;&lt;/span&gt; 8 &lt;span style="color:;"&gt;&lt;font color="#808080"&gt;=&lt;/font&gt;&lt;/span&gt; 8&lt;span style="color:;"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/span&gt;
&lt;span style="color:;"&gt;&lt;font color="#0000ff"&gt;BEGIN&lt;/font&gt;&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000ff"&gt;PRINT&lt;/font&gt;&lt;/span&gt;&amp;#160;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;'Bucket 4 insertions'&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#808080"&gt;;&lt;/font&gt;&lt;/span&gt;
&lt;span style="color:;"&gt;&lt;font color="#0000ff"&gt;END&lt;/font&gt;&lt;/span&gt;
&lt;span style="color:;"&gt;&lt;font color="#0000ff"&gt;IF &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/span&gt;@bitmask &lt;span style="color:;"&gt;&lt;font color="#808080"&gt;&amp;amp;&lt;/font&gt;&lt;/span&gt; 16 &lt;span style="color:;"&gt;&lt;font color="#808080"&gt;=&lt;/font&gt;&lt;/span&gt; 16&lt;span style="color:;"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/span&gt;
&lt;span style="color:;"&gt;&lt;font color="#0000ff"&gt;BEGIN&lt;/font&gt;&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000ff"&gt;PRINT&lt;/font&gt;&lt;/span&gt;&amp;#160;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;'Bucket 5 insertions'&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#808080"&gt;;&lt;/font&gt;&lt;/span&gt;
&lt;span style="color:;"&gt;&lt;font color="#0000ff"&gt;END&lt;/font&gt;&lt;/span&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;/blockquote&gt;

&lt;p&gt;An example of running this using DeployData=6&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;a href="http://sqlblog.com/blogs/jamie_thomson/image_635C9FBF.png"&gt;&lt;img style="background-image:none;border-bottom:0px;border-left:0px;padding-left:0px;padding-right:0px;display:inline;border-top:0px;border-right:0px;padding-top:0px;" title="image" border="0" alt="image" src="http://sqlblog.com/blogs/jamie_thomson/image_thumb_7D505FE1.png" width="667" height="480" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The binary representation of 6 is 110. The second and third significant bits of that binary number are set to 1 and hence buckets 2 and 3 are “activated”.&lt;/p&gt;

&lt;p&gt;Hope that makes sense and is useful to some of you!&lt;/p&gt;

&lt;p&gt;&lt;a href="http://twitter.com/jamiet" target="_blank"&gt;@Jamiet&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;P.S. I used the awesome &lt;a href="http://blogs.msdn.com/b/kirillosenkov/archive/2010/06/07/copy-code-in-html-format-with-visual-studio-2010.aspx" target="_blank"&gt;HTML Copy&lt;/a&gt; feature of Visual Studio’s &lt;a href="http://visualstudiogallery.msdn.microsoft.com/d0d33361-18e2-46c0-8ff2-4adea1e34fef/" target="_blank"&gt;Productivity Power Tools&lt;/a&gt; in order to format the T-SQL code above for this blog post.&lt;/p&gt;</description></item><item><title>Smart defaults [SSDT]</title><link>http://sqlblog.com/blogs/jamie_thomson/archive/2012/05/31/smart-defaults-ssdt.aspx</link><pubDate>Thu, 31 May 2012 10:55:12 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:43657</guid><dc:creator>jamiet</dc:creator><description>&lt;p&gt;I’ve just discovered a new, somewhat hidden, feature in SSDT that I didn’t know about and figured it would be worth highlighting here because I’ll bet not many others know it either; the feature is called Smart Defaults. It gets around the problem of adding a NOT NULLable column to an existing table that has got data in it – previous to SSDT you would need to define a DEFAULT constraint however it does feel rather cumbersome to create an object purely for the purpose of pushing through a deployment – that’s the situation that Smart Defaults is meant to alleviate.&lt;/p&gt;  &lt;p&gt;The Smart Defaults option exists in the advanced section of a &lt;a href="http://sqlblog.com/blogs/jamie_thomson/archive/2012/05/09/publish-profile-files-in-sql-server-data-tools-ssdt.aspx" target="_blank"&gt;Publish Profile file&lt;/a&gt;:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://sqlblog.com/blogs/jamie_thomson/image_1D319F70.png"&gt;&lt;img style="background-image:none;border-right-width:0px;padding-left:0px;padding-right:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px;" title="image" border="0" alt="image" src="http://sqlblog.com/blogs/jamie_thomson/image_thumb_09380CDA.png" width="322" height="393" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The description of the setting is “&lt;strong&gt;Automatically provides a default value when updating a table that contains data with a column that does not allow null values&lt;/strong&gt;”, in other words checking that option will cause SSDT to insert an arbitrary default value into your newly created NON NULLable column. In case you’re wondering how it does it, here’s how:&lt;/p&gt;  &lt;p&gt;SSDT creates a DEFAULT CONSTRAINT at the same time as the column is created and then immediately removes that constraint:&lt;/p&gt;  &lt;blockquote&gt;   &lt;pre style="font-size:12px;"&gt;&lt;font color="blue"&gt;ALTER TABLE &lt;/font&gt;&lt;font color="black"&gt;[dbo].[T1]&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="blue"&gt;ADD &lt;/font&gt;&lt;font color="black"&gt;[C1] &lt;/font&gt;&lt;font color="blue"&gt;INT &lt;/font&gt;&lt;font color="gray"&gt;NOT NULL, &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="blue"&gt;CONSTRAINT &lt;/font&gt;&lt;font color="black"&gt;[SD_T1_1df7a5f76cf44bb593506d05ff9a1e2b] &lt;/font&gt;&lt;font color="blue"&gt;DEFAULT &lt;/font&gt;&lt;font color="black"&gt;0 &lt;/font&gt;&lt;font color="blue"&gt;FOR &lt;/font&gt;&lt;font color="black"&gt;[C1]&lt;/font&gt;&lt;font color="gray"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;/font&gt;&lt;font color="blue"&gt;ALTER TABLE &lt;/font&gt;&lt;font color="black"&gt;[dbo].[T1] &lt;/font&gt;&lt;font color="blue"&gt;DROP CONSTRAINT &lt;/font&gt;&lt;font color="black"&gt;[SD_T1_1df7a5f76cf44bb593506d05ff9a1e2b]&lt;/font&gt;&lt;font color="gray"&gt;;&lt;/font&gt;&lt;/pre&gt;
&lt;/blockquote&gt;

&lt;p&gt;You can then update the value as appropriate in a Post-Deployment script. Pretty cool!&lt;/p&gt;

&lt;p&gt;On the downside, you can only specify this option for the whole project, not for an individual table or even an individual column – I’m not sure that I’d want to turn this on for an entire project as it could hide problems that a failed deployment would highlight, in other words smart defaults could be seen to be “papering over the cracks”. If you think that should be improved go and vote (and leave a comment) at &lt;a href="https://connect.microsoft.com/SQLServer/feedback/details/745175/ssdt-allow-us-to-specify-smart-defaults-per-table-or-even-per-column" target="_blank"&gt;[SSDT] Allow us to specify Smart defaults per table or even per column&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://twitter.com/jamiet" target="_blank"&gt;@Jamiet&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Redistribution of sqlpackage.exe [SSDT]</title><link>http://sqlblog.com/blogs/jamie_thomson/archive/2012/05/30/redistribution-of-sqlpackage-exe-ssdt.aspx</link><pubDate>Wed, 30 May 2012 14:15:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:43648</guid><dc:creator>jamiet</dc:creator><description>&lt;p&gt;&lt;i&gt;This is a short note for anyone that may be interested in redistributing sqlpackage.exe. If this isn’t you then no need to keep reading. Ostensibly this is here for anyone that bingles for this information.&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;sqlpackage.exe is a command-line that ships with SQL Server Development Tools (SSDT) in SQL Server 2012 and its main purpose (amongst other things) is to deploy .dacpac files from the command-line. Its quite conceivable that one might want to install only sqlpackage.exe rather than the full SSDT suite (for example on a production server) and I myself have recently had that need. I enquired to the SSDT product team about the possibility of doing this. I said:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;i&gt;Back in VS DB Proj days it was possible to use VSDBCMD.exe on a machine that did not have the full VS shell install by shipping lots of pre-requisites along for the ride (details at &lt;/i&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/dd193258.aspx"&gt;&lt;i&gt;How to: Prepare a Database for Deployment From a Command Prompt by Using VSDBCMD.EXE&lt;/i&gt;&lt;/a&gt;&lt;i&gt;).&lt;/i&gt;&lt;/p&gt;    &lt;p&gt;&lt;i&gt;Is there a similar mechanism for using VSDBMCD.exe’s replacement, &lt;/i&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/hh550080(v=vs.103).aspx"&gt;&lt;i&gt;sqlpackage.exe&lt;/i&gt;&lt;/a&gt;&lt;i&gt;?&lt;/i&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;here was the reply from Barclay Hill who heads up the development team:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;i&gt;Yes, SQLPackage.exe is the analogy of VSDBCMD.exe. You can acquire separately, in a stand-alone package, by installing DACFX.&lt;/i&gt;&lt;/p&gt;    &lt;p&gt;&lt;i&gt;You can get it from:&lt;/i&gt;&lt;/p&gt;    &lt;ul&gt;     &lt;li&gt;&lt;i&gt;Feature pack is here: &lt;/i&gt;&lt;a href="http://www.microsoft.com/en-us/download/details.aspx?id=29065"&gt;&lt;i&gt;http://www.microsoft.com/en-us/download/details.aspx?id=29065&lt;/i&gt;&lt;/a&gt;&lt;/li&gt;      &lt;li&gt;&lt;i&gt;Web Platform Installer here: &lt;/i&gt;&lt;a href="http://www.microsoft.com/web/gallery/install.aspx?appid=DACFX"&gt;&lt;i&gt;http://www.microsoft.com/web/gallery/install.aspx?appid=DACFX&lt;/i&gt;&lt;/a&gt;&lt;/li&gt;   &lt;/ul&gt;    &lt;p&gt;&lt;i&gt;You will notice it has dependencies on SQLDOM and SQLCLRTYPES.&amp;nbsp; WebPI will install these for you, but it is al carte on the feature pack.&lt;/i&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;So, now you know. I didn’t enquire about licensing of DACFX but given SSDT is free I am going to assume that the same applies to DACFX too.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://twitter.com/jamiet"&gt;@Jamiet&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;float:none;white-space:normal;orphans:2;widows:2;font-size-adjust:none;font-stretch:normal;-webkit-text-size-adjust:auto;-webkit-text-stroke-width:0px;"&gt;UPDATE: Gert Drapers has posted an article&amp;nbsp;&lt;/span&gt;&lt;span style="text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-size-adjust:none;font-stretch:normal;-webkit-text-size-adjust:auto;-webkit-text-stroke-width:0px;"&gt;&lt;a target="_blank" href="http://sqlproj.com/index.php/2012/03/headless-msbuild-support-for-ssdt-sqlproj-projects/"&gt;Headless MSBuild Support for SSDT (*.sqlproj) Projects&lt;/a&gt;&amp;nbsp;in which he describes five seperate installations that need to be performed in order to run SSDT deployment without installing Visual Studio:&lt;/span&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-size-adjust:none;font-stretch:normal;-webkit-text-size-adjust:auto;-webkit-text-stroke-width:0px;"&gt;dacframework.msi&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-size-adjust:none;font-stretch:normal;-webkit-text-size-adjust:auto;-webkit-text-stroke-width:0px;"&gt;SQLDOM.msi&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-size-adjust:none;font-stretch:normal;-webkit-text-size-adjust:auto;-webkit-text-stroke-width:0px;"&gt;SQLLS.msi&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-size-adjust:none;font-stretch:normal;-webkit-text-size-adjust:auto;-webkit-text-stroke-width:0px;"&gt;SQLSysClrTypes.msi&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-size-adjust:none;font-stretch:normal;-webkit-text-size-adjust:auto;-webkit-text-stroke-width:0px;"&gt;SSDTBuildUtilities.msi&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;(see Gert's article for links to those five installation files)&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-size-adjust:none;font-stretch:normal;-webkit-text-size-adjust:auto;-webkit-text-stroke-width:0px;"&gt;Notice that two of those are mentioned in Barclay's quote above. I do not know if the other three are installed by WebPI or even whether they are required for sqlpackage.exe to work, one day I hope to get a clear answer on that from someone at Microsoft. Until that data comes, use the information here and in Gert's article to get your deployments working.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Publish Profile Files in SQL Server Data Tools (SSDT)</title><link>http://sqlblog.com/blogs/jamie_thomson/archive/2012/05/08/publish-profile-files-in-sql-server-data-tools-ssdt.aspx</link><pubDate>Tue, 08 May 2012 22:07:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:43267</guid><dc:creator>jamiet</dc:creator><description>&lt;p&gt;I have been using &lt;a href="http://msdn.microsoft.com/en-us/data/gg427686" target="_blank"&gt;SQL Server Data Tools&lt;/a&gt; (SSDT) both at work and on some hobby projects for quite a few weeks now and of all the new features I have to say the one that I am appreciating the most is Publish Profile files. I have been searching around on MSDN for an article that explains Publish Profile files but it seems no such article exists so I’ll attempt to surmise here.&lt;/p&gt;  &lt;p&gt;Publish Profile files are, essentially, a collection of all the property key-value pairs that are needed to deploy a database model (i.e. a &lt;a href="http://www.fileinfo.com/extension/dacpac" target="_blank"&gt;.dacpac&lt;/a&gt;) to some target database. Those properties include (but are not limited to):&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;database name&lt;/li&gt;    &lt;li&gt;connection string&lt;/li&gt;    &lt;li&gt;whether or not to publish SSDT projects on which the current project has a dependency&lt;/li&gt;    &lt;li&gt;Recreate the database from scratch (or not)&lt;/li&gt;    &lt;li&gt;Backup before deploy&lt;/li&gt;    &lt;li&gt;Drop unknown objects in target&lt;/li&gt;    &lt;li&gt;SQLCMD Variables&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Those that have used the predecessor to SSDT, Visual Studio Database Projects, will be familiar with a lot of those properties however in that case the properties had to be specified on a case-by-case basis; typically in an msbuild script or similar. Often those scripts are not maintained by a developer – rather they are maintained by a &lt;a href="http://en.wikipedia.org/wiki/DevOps" target="_blank"&gt;DevOps&lt;/a&gt; team that are not familiar with the code being deployed and as a developer myself that’s not a situation that I’m at all comfortable with. On my most recent project where Visual Studio Database Projects were being used I faced the maddening situation where every new SQLCMD variable added to a project required an email to be sent to the DevOps team to ask them to update their scripts accordingly. As you can imagine human errors crept in (on our side more than the DevOps side) and we ended up deploying projects with the wrong SQLCMD values. Moreover, we had to deal with different DevOps folks and often they would store the values in different places; totally infuriating, believe me.&lt;/p&gt;  &lt;p&gt;Publish Profile files make this process much easier because we can define all those properties on a per-environment basis and keep them in a dedicated Publish Profile file. The obvious benefit then is that a Publish Profile file &lt;em&gt;abstracts&lt;/em&gt; all of the environment-specific information into a single file so deploying an SSDT project now requires only two things; the build output (i.e. a .dacpac file) and a Publish Profile file:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font face="Courier New"&gt;&amp;gt;sqlpackage.exe /sf:MyDB.dacpac /pr:DEV.publish.xml&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The implied benefit (and this is what I really like about them) is that Publish Profile files are a source code artefact that a developer maintains the same as they would any other source code artefact, all that the DevOps people need are the build output (i.e. a .dacpac file) and an appropriately named Publish Profile file. Developers are now wholly in charge of how their code gets deployed which keeps them happy and the DevOps people have less work to do – so they’re a happy bunch too! I’m not saying that the wrong values won’t ever be supplied but at least now we know exactly where to go to fix those errors.&lt;/p&gt;  &lt;p&gt;SSDT also provides a friendly UI for maintaining these Publish Profile files. Double-click on one and this UI appears:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://sqlblog.com/blogs/jamie_thomson/image_4D2EC0B8.png"&gt;&lt;img width="517" height="510" title="image" style="border:0px currentColor;padding-top:0px;padding-right:0px;padding-left:0px;display:inline;background-image:none;" alt="image" src="http://sqlblog.com/blogs/jamie_thomson/image_thumb_5F97116D.png" border="0"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Its fairly self-explanatory to fill these things out. A connection string, a database name and values for each SQLCMD variable defined within the project and you’re pretty much there. (I have written previously about one other benefit of Publish Profile files - that they can be used to make SQLCMD variables mandatory. Read more at &lt;a href="http://sqlblog.com/blogs/jamie_thomson/archive/2012/02/12/sql-server-data-tools-does-support-required-variables.aspx" target="_blank"&gt;SQL Server Data Tools does support required variables&lt;/a&gt;.)&lt;/p&gt;  &lt;p&gt;One minor downside of Publish Profile files is that they get created in the root of your SSDT project (I have griped about this previously at &lt;a href="http://sqlblog.com/blogs/jamie_thomson/archive/2012/04/15/folders-in-sql-server-data-tools.aspx" target="_blank"&gt;Folders in SQL Server Data Tools&lt;/a&gt;) so the convention that I have been using is to create a folder called Publish in each SSDT project and move all Publish Profile files into there.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://sqlblog.com/blogs/jamie_thomson/image_5DE64599.png"&gt;&lt;img width="300" height="185" title="image" style="border:0px currentColor;padding-top:0px;padding-right:0px;padding-left:0px;display:inline;background-image:none;" alt="image" src="http://sqlblog.com/blogs/jamie_thomson/image_thumb_5D0DDFAF.png" border="0"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Hopefully this has given you a small taster of what Publish Profile files are all about. I’ll probably share some msbuild scripts that we’re using to deploy these things in a later blog post.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://twitter.com/jamiet"&gt;@Jamiet&lt;/a&gt;&amp;nbsp;&lt;/p&gt;  &lt;p&gt;P.S. As an aside, I have requested that the SSIS/SSAS/SSRS teams adopt the Publish Profile file approach in future iterations of their products. If you think that that is something you would like to see happen then &lt;a href="https://connect.microsoft.com/sqlserver/feedback/details/740059/ssis-collect-all-deployment-specific-properties-into-a-single-file#details" target="_blank"&gt;click through, vote and leave a comment&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;UPDATE: If you want a bit more info on Publish Profile files and sqlpackage.exe check out Ben Day's blog post &lt;a href="http://www.benday.com/2012/12/18/deploy-a-sql-server-database-projects-dacpac-with-sqlpackage-exe/" target="_blank"&gt;Deploy a SQL Server Database project’s *.dacpac with SqlPackage.exe&lt;/a&gt;&lt;/p&gt;</description></item></channel></rss>