<?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 Data Tools', 'SQL Server 2012', 'sql server', and 'SSDT'</title><link>http://sqlblog.com/search/SearchResults.aspx?o=DateDescending&amp;tag=SQL+Server+Data+Tools,SQL+Server+2012,sql+server,SSDT&amp;orTags=0</link><description>Search results matching tags 'SQL Server Data Tools', 'SQL Server 2012', 'sql server', and 'SSDT'</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>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><item><title>SQL Server Data Tools does support required variables</title><link>http://sqlblog.com/blogs/jamie_thomson/archive/2012/02/12/sql-server-data-tools-does-support-required-variables.aspx</link><pubDate>Sun, 12 Feb 2012 11:58:24 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:41704</guid><dc:creator>jamiet</dc:creator><description>&lt;p&gt;Over the past few years of using datadude (aka DBPro aka Visual Studio Database Projects) I have fallen prey to a peculiar little nuance – if you forget to supply a value for a sqlcmd variable then it will simply use a default and often that is not the desired behaviour. Hence why yesterday I submitted the following suggestion to &lt;a href="http://connect.microsoft.com/sqlserver/feedback"&gt;http://connect.microsoft.com/sqlserver/feedback&lt;/a&gt; :&lt;/p&gt;  &lt;blockquote&gt;   &lt;h3&gt;&lt;em&gt;Specify sqlcmdvars properties as &amp;quot;required to be overridden”&lt;/em&gt;&lt;/h3&gt;    &lt;p&gt;&lt;em&gt;In my current place of work I am responsible for maintaining our datadude projects and we have another team that is in charge of deployments. Hence, when we place new properties into the sqlcmdvars file I need to tell the deployment team what values to supply for that property per environment (dev, systest, uat, prod).       &lt;br /&gt;Unfortunately lack of communication/human error occasionally creeps in and, for whatever reason, no value gets supplied for some property at deployment time. If this is the case the default value as specified in the sqlcmdvars file gets used instead - invariably this will be the wrong value. I would like a mechanism within SSDT of preventing this from ever happening.&lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;One simple way to prevent this would be to specify that a sqlcmdvars property is *required* to be overridden during the deployment. In other words, never use the default. if an override is not supplied at deployment time then the deployment should fail.       &lt;br /&gt;Note that this stipulation should only be in place when deployment occurs from the command-line - if deploying from Visual Studio the default should be allowed (simply because Visual Studio doesn't provide a way to specify anything other than the default value supplied in the sqlcmdvars file).&lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;a href="https://connect.microsoft.com/sqlserver/feedback/details/724366/ssdt-specify-sqlcmdvars-properties-as-required-to-be-overridden#details"&gt;&lt;em&gt;https://connect.microsoft.com/sqlserver/feedback/details/724366/ssdt-specify-sqlcmdvars-properties-as-required-to-be-overridden#details&lt;/em&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;It transpires that this requested feature is already available in the forthcoming SQL Server Data Tools (SSDT) as I shall now demonstrate. This screenshot shows the project properties of a SSDT project where we define the sqlcmd variables, I have defined a variable called $(Id_value):&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://sqlblog.com/blogs/jamie_thomson/image_49257C87.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_63856F9E.png" width="732" height="259" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;In SSDT the nomenclature for deploying a project is “Publish”, a function that can be found by right-clicking on a project in Solution Explorer:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://sqlblog.com/blogs/jamie_thomson/image_1438774A.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_05219870.png" width="368" height="248" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Selecting that brings up the Publish dialog.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://sqlblog.com/blogs/jamie_thomson/image_4AC6228E.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_6FE36CFA.png" width="554" height="536" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Notice how the “Publish” button is greyed out – that it because I have not supplied a value for $(Id_value); supplying a value enables the Publish button and I can go ahead and publish my project. In other words, SSDT &lt;em&gt;insists&lt;/em&gt; that I supply a value for that variable – exactly as I requested in my Connect submission.&lt;/p&gt;  &lt;p&gt;The same is true if I use the command-line publishing tool sqlpackage.exe. The following command does essentially the same thing as the above depicted Publish dialog:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;gt;sqlpackage.exe /TargetDatabaseName:MyDB /TargetServerName:&amp;quot;.\RC0&amp;quot; /Action:Publish /SourceFile:&amp;quot;TestRequiredSqlCmdVars.dacpac&amp;quot;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Executing that gives me an error:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Publishing to database 'MyDB' on server '.\RC0'.     &lt;br /&gt;&lt;font color="#ff0000"&gt;*** Missing values for the following SqlCmd variables:       &lt;br /&gt;'Id_value'.&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Here’s a screenshot showing the same:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://sqlblog.com/blogs/jamie_thomson/image_40454E6E.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_05E9D88D.png" width="618" height="201" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;In order to supply a value for the variable from the command-line you need to use the /v: switch like so:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;gt;sqlpackage.exe /TargetDatabaseName:MyDB /TargetServerName:&amp;quot;.\RC0&amp;quot; /Action:Publish /SourceFile:&amp;quot;TestRequiredSqlCmdVars.dacpac&amp;quot; &lt;strong&gt;/v:Id_value=1&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;&lt;a href="http://sqlblog.com/blogs/jamie_thomson/image_4B8E62AB.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_5C265D99.png" width="617" height="201" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;As you can see, publish was successful!&lt;/p&gt;  &lt;p&gt;So there you go, using SSDT you’ll no longer be able to fall prey to the problem I highlighted at the top of this blog post. In a later blog post I’ll show how you CAN supply a default value if you want to and also how you can override for your local environment.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://twitter.com/jamiet"&gt;@jamiet&lt;/a&gt;&lt;/p&gt;</description></item></channel></rss>