Search results matching tags 'SQL Server 2012' and 'Deployment'http://sqlblog.com/search/SearchResults.aspx?o=DateDescending&tag=SQL+Server+2012,Deployment&orTags=0Search results matching tags 'SQL Server 2012' and 'Deployment'en-USCommunityServer 2.1 SP2 (Build: 61129.1)SSIS Design Patterns, the Bookhttp://sqlblog.com/blogs/andy_leonard/archive/2012/08/06/ssis-design-patterns-the-book.aspxMon, 06 Aug 2012 16:37:43 GMT21093a07-8b3d-42db-8cbf-3350fcbf5496:44587andyleonard<p>For the past two years, I have had the honor and privilege or authoring <a href="http://www.amazon.com/SSIS-Design-Patterns-Matt-Masson/dp/1430237716" target="_blank">SSIS Design Patterns</a> alongside Jessica Moss, Michelle Ufford, Tim Mitchell, and Matt Masson. Publication of the book – like many projects of this scope – has been delayed. The current publication date is 27 Aug 2012 and I have high confidence in this date. </p> <p>I take responsibility for publication delays and apologize to those who pre-ordered the book. The reasons for the delays are not important. I have built a career as a software developer and architect based on the following maxim:</p> <blockquote> <p><em>Deliver quality late, no one remembers. <br />Deliver junk on time, no one forgets.</em></p> </blockquote> <p>The shared goal of everyone working on this project has been to deliver quality. Proofing the manuscripts, I believe we have achieved that goal. </p> <p>:{&gt;</p>Publish Profile Files in SQL Server Data Tools (SSDT)http://sqlblog.com/blogs/jamie_thomson/archive/2012/05/08/publish-profile-files-in-sql-server-data-tools-ssdt.aspxTue, 08 May 2012 22:07:00 GMT21093a07-8b3d-42db-8cbf-3350fcbf5496:43267jamiet<p>I have been using <a href="http://msdn.microsoft.com/en-us/data/gg427686" target="_blank">SQL Server Data Tools</a> (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.</p> <p>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 <a href="http://www.fileinfo.com/extension/dacpac" target="_blank">.dacpac</a>) to some target database. Those properties include (but are not limited to):</p> <ul> <li>database name</li> <li>connection string</li> <li>whether or not to publish SSDT projects on which the current project has a dependency</li> <li>Recreate the database from scratch (or not)</li> <li>Backup before deploy</li> <li>Drop unknown objects in target</li> <li>SQLCMD Variables</li> </ul> <p>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 <a href="http://en.wikipedia.org/wiki/DevOps" target="_blank">DevOps</a> 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.</p> <p>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 <em>abstracts</em> 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:</p> <blockquote> <p><font face="Courier New">&gt;sqlpackage.exe /sf:MyDB.dacpac /pr:DEV.publish.xml</font></p> </blockquote> <p>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.</p> <p>SSDT also provides a friendly UI for maintaining these Publish Profile files. Double-click on one and this UI appears:</p> <blockquote> <p><a href="http://sqlblog.com/blogs/jamie_thomson/image_4D2EC0B8.png"><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"></a></p> </blockquote> <p>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 <a href="http://sqlblog.com/blogs/jamie_thomson/archive/2012/02/12/sql-server-data-tools-does-support-required-variables.aspx" target="_blank">SQL Server Data Tools does support required variables</a>.)</p> <p>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 <a href="http://sqlblog.com/blogs/jamie_thomson/archive/2012/04/15/folders-in-sql-server-data-tools.aspx" target="_blank">Folders in SQL Server Data Tools</a>) 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.</p> <blockquote> <p><a href="http://sqlblog.com/blogs/jamie_thomson/image_5DE64599.png"><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"></a></p> </blockquote> <p>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.</p> <p><a href="http://twitter.com/jamiet">@Jamiet</a>&nbsp;</p> <p>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 <a href="https://connect.microsoft.com/sqlserver/feedback/details/740059/ssis-collect-all-deployment-specific-properties-into-a-single-file#details" target="_blank">click through, vote and leave a comment</a>.</p><p>UPDATE: If you want a bit more info on Publish Profile files and sqlpackage.exe check out Ben Day's blog post <a href="http://www.benday.com/2012/12/18/deploy-a-sql-server-database-projects-dacpac-with-sqlpackage-exe/" target="_blank">Deploy a SQL Server Database project’s *.dacpac with SqlPackage.exe</a></p>