<?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' and 'sqlpackage.exe'</title><link>http://sqlblog.com/search/SearchResults.aspx?o=DateDescending&amp;tag=SQL+Server+Data+Tools,sqlpackage.exe&amp;orTags=0</link><description>Search results matching tags 'SQL Server Data Tools' and 'sqlpackage.exe'</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><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>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>