{"id":494,"date":"2012-04-17T14:06:00","date_gmt":"2012-04-17T14:06:00","guid":{"rendered":"\/blogs\/bobb\/post\/Adventures-in-autodeploy-SQL-Server-2012-SSDT-and-SQLCLR.aspx"},"modified":"2012-04-17T14:06:00","modified_gmt":"2012-04-17T14:06:00","slug":"adventures-in-autodeploy-sql-server-2012-ssdt-and-sqlclr","status":"publish","type":"post","link":"https:\/\/www.sqlskills.com\/blogs\/bobb\/adventures-in-autodeploy-sql-server-2012-ssdt-and-sqlclr\/","title":{"rendered":"Adventures in autodeploy: SQL Server 2012, SSDT, and SQLCLR"},"content":{"rendered":"<p>\nI&#39;m the kind of person that doesn&#39;t often\/always use Visual Studio &quot;autodeploy&quot; (that is, the &quot;Deploy Solution&quot; option) for SQLCLR projects. It&#39;s always been missing things (like ALTER ASSEMBLY) and never quite kept up with the newer things you could do with SQLCLR (e.g. ordered table-valued functions, multiparameter aggregates). But every once-in-a-while, especially while I&#39;m teaching and writing example assemblies on-the-fly, its a useful way to get things cataloged fast without writing DDL.\n<\/p>\n<p>\nSo when I installed SQL Server 2012 and the SQL Server Data Tools on top of an existing VS2010 installation, I was not entirely surprised that, when opening a SQLCLR project, I was prompted to &quot;convert to an SSDT project or leave it alone&quot;. Either choice promised me that &quot;I wouldn&#39;t be prompted again&quot; but I didn&#39;t want that. So I simply cancelled out of the dialog.\n<\/p>\n<p>\nHowever, VS2010 SQLCLR projects autodeploy *doesn&#39;t work* against a SQL2012 database. Ever.<br \/>\nEven with the simplest projects. A profiler trace of the proceedings looks like some of the<br \/>\nDDL it generates is incompatible with SQL Server 2012. Hrmph.\n<\/p>\n<p>\nSo now I choose the &quot;convert&quot; option, and expect to see a full-fledged SSDT project in<br \/>\nSolution Explorer after the conversion. I don&#39;t. Looks like I have approximately the same<br \/>\nproject. Not so. Looking at the project properties gives me all the SSDT properties, and<br \/>\nusing &quot;Add\/New Item&quot; on the project gives the entire list of (85 or so) items that you can<br \/>\nadd to an SSDT project. So I DO have a full-fledged SSDT project. Does not mean I&#39;ll have to<br \/>\nimport the rest of the database objects to get &quot;autodeploy&quot; (there&#39;s no &quot;Deploy Solution&quot; but<br \/>\nthere is a Publish&#8230; option) to work??\n<\/p>\n<p>\nLet&#39;s try this on the pubs database (I can always re-create the pubs database if something<br \/>\ngoes wrong). And &quot;Publish&quot; simply publishes the assembly, leaving the rest of the database<br \/>\nundisturbed. Turns out that is what I want, so&#8230;great.\n<\/p>\n<p>\nNow, I&#39;ve made the moral equivalent of a SQL Server 2012\/VS2012 SQLCLR project by conversion.<br \/>\nHow do I make a new one? There no choice with SSDT but &quot;Other Languages\/SQL Server\/SQL Server<br \/>\nDatabase Project&quot;. Made an empty one of those. So let&#39;s make an assembly. Add\/New Item&#8230;and<br \/>\nthe SQLCLR items don&#39;t appear in the list of all new items. But there is a branch off the<br \/>\ntree for &quot;SQL CLR&quot; and &quot;SQL CLR C#&quot;. The &quot;SQL CLR&quot; is VB.NET. So first, I need to add an<br \/>\nassembly info file, if I want one of these. So far, so good, but there are no referenced<br \/>\nassemblies other than .NET 4.0&#39;s System.Dll (the properties window, SQLCLR tab, show Assembly<br \/>\nInfo and fill in the dialog does the same thing). It looks like it&#39;s smart enough to build a .NET 4.0 target because my target database in project properties is SQL Server 2012.&nbsp;Now let&#39;s add a SQLCLR UDF (the default<br \/>\ntemplate for this no longer returns &quot;Hello&quot;, but String.Empty, hmmm&#8230;). And I do get<br \/>\nSystem.Data and System.Xml added to the references. And Build and Publish works. BTW, during<br \/>\nthe &quot;Publish&quot; process, you also have the ability the generate a publishing script rather than<br \/>\npublish in real-time. That&#39;s nice.\n<\/p>\n<p>\nSo, I&#39;ll go through of compare the generated DDL later and see if I can do anything in SQLCLR<br \/>\n2012 that SQLCLR 2008 autodeploy (Publish\/Deploy) can&#39;t do. For now, I at least have a way to<br \/>\nreplicate the functionality of SQLCLR projects. That&#39;s works with a SQL Server 2012 (and 2008<br \/>\nand 2005, though I didn&#39;t try each one, I&#39;ll take them at their word, for now) database. Whew! But, once you&#39;ve converted the<br \/>\noriginal VS2010 project (unless you choose, &quot;save old project&quot; during conversion) you can&#39;t<br \/>\ngo &quot;home&quot; anymore&#8230; You&#39;re in SSDT-project-land now.\n<\/p>\n<p>\n@bobbeauch<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#39;m the kind of person that doesn&#39;t often\/always use Visual Studio &quot;autodeploy&quot; (that is, the &quot;Deploy Solution&quot; option) for SQLCLR projects. It&#39;s always been missing things (like ALTER ASSEMBLY) and never quite kept up with the newer things you could do with SQLCLR (e.g. ordered table-valued functions, multiparameter aggregates). But every once-in-a-while, especially while I&#39;m [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[31,33,38],"tags":[],"class_list":["post-494","post","type-post","status-publish","format-standard","hentry","category-sql-server-2012","category-sql-server-data-tools","category-sqlclr"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.9.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Adventures in autodeploy: SQL Server 2012, SSDT, and SQLCLR - Bob Beauchemin<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.sqlskills.com\/blogs\/bobb\/adventures-in-autodeploy-sql-server-2012-ssdt-and-sqlclr\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Adventures in autodeploy: SQL Server 2012, SSDT, and SQLCLR - Bob Beauchemin\" \/>\n<meta property=\"og:description\" content=\"I&#039;m the kind of person that doesn&#039;t often\/always use Visual Studio &quot;autodeploy&quot; (that is, the &quot;Deploy Solution&quot; option) for SQLCLR projects. It&#039;s always been missing things (like ALTER ASSEMBLY) and never quite kept up with the newer things you could do with SQLCLR (e.g. ordered table-valued functions, multiparameter aggregates). But every once-in-a-while, especially while I&#039;m [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlskills.com\/blogs\/bobb\/adventures-in-autodeploy-sql-server-2012-ssdt-and-sqlclr\/\" \/>\n<meta property=\"og:site_name\" content=\"Bob Beauchemin\" \/>\n<meta property=\"article:published_time\" content=\"2012-04-17T14:06:00+00:00\" \/>\n<meta name=\"author\" content=\"Bob Beauchemin\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Bob Beauchemin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/adventures-in-autodeploy-sql-server-2012-ssdt-and-sqlclr\/\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/adventures-in-autodeploy-sql-server-2012-ssdt-and-sqlclr\/\",\"name\":\"Adventures in autodeploy: SQL Server 2012, SSDT, and SQLCLR - Bob Beauchemin\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/#website\"},\"datePublished\":\"2012-04-17T14:06:00+00:00\",\"dateModified\":\"2012-04-17T14:06:00+00:00\",\"author\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/#\/schema\/person\/62bfa986c5b5d28fcffd8b4fc409c73e\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/adventures-in-autodeploy-sql-server-2012-ssdt-and-sqlclr\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sqlskills.com\/blogs\/bobb\/adventures-in-autodeploy-sql-server-2012-ssdt-and-sqlclr\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/adventures-in-autodeploy-sql-server-2012-ssdt-and-sqlclr\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SQL Server 2012\",\"item\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/category\/sql-server-2012\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Adventures in autodeploy: SQL Server 2012, SSDT, and SQLCLR\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/#website\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/\",\"name\":\"Bob Beauchemin\",\"description\":\"SQL Server Blog\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/#\/schema\/person\/62bfa986c5b5d28fcffd8b4fc409c73e\",\"name\":\"Bob Beauchemin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/6f80e6cc667410857fa6a21931dc528b8092f4d112bf7a8ff7c267674d44ee37?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/6f80e6cc667410857fa6a21931dc528b8092f4d112bf7a8ff7c267674d44ee37?s=96&d=mm&r=g\",\"caption\":\"Bob Beauchemin\"},\"sameAs\":[\"http:\/www.sqlskills.com\/blogs\/bobb\/\"],\"url\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/author\/bobb\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Adventures in autodeploy: SQL Server 2012, SSDT, and SQLCLR - Bob Beauchemin","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.sqlskills.com\/blogs\/bobb\/adventures-in-autodeploy-sql-server-2012-ssdt-and-sqlclr\/","og_locale":"en_US","og_type":"article","og_title":"Adventures in autodeploy: SQL Server 2012, SSDT, and SQLCLR - Bob Beauchemin","og_description":"I&#39;m the kind of person that doesn&#39;t often\/always use Visual Studio &quot;autodeploy&quot; (that is, the &quot;Deploy Solution&quot; option) for SQLCLR projects. It&#39;s always been missing things (like ALTER ASSEMBLY) and never quite kept up with the newer things you could do with SQLCLR (e.g. ordered table-valued functions, multiparameter aggregates). But every once-in-a-while, especially while I&#39;m [&hellip;]","og_url":"https:\/\/www.sqlskills.com\/blogs\/bobb\/adventures-in-autodeploy-sql-server-2012-ssdt-and-sqlclr\/","og_site_name":"Bob Beauchemin","article_published_time":"2012-04-17T14:06:00+00:00","author":"Bob Beauchemin","twitter_misc":{"Written by":"Bob Beauchemin","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/adventures-in-autodeploy-sql-server-2012-ssdt-and-sqlclr\/","url":"https:\/\/www.sqlskills.com\/blogs\/bobb\/adventures-in-autodeploy-sql-server-2012-ssdt-and-sqlclr\/","name":"Adventures in autodeploy: SQL Server 2012, SSDT, and SQLCLR - Bob Beauchemin","isPartOf":{"@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/#website"},"datePublished":"2012-04-17T14:06:00+00:00","dateModified":"2012-04-17T14:06:00+00:00","author":{"@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/#\/schema\/person\/62bfa986c5b5d28fcffd8b4fc409c73e"},"breadcrumb":{"@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/adventures-in-autodeploy-sql-server-2012-ssdt-and-sqlclr\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlskills.com\/blogs\/bobb\/adventures-in-autodeploy-sql-server-2012-ssdt-and-sqlclr\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/adventures-in-autodeploy-sql-server-2012-ssdt-and-sqlclr\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlskills.com\/blogs\/bobb\/"},{"@type":"ListItem","position":2,"name":"SQL Server 2012","item":"https:\/\/www.sqlskills.com\/blogs\/bobb\/category\/sql-server-2012\/"},{"@type":"ListItem","position":3,"name":"Adventures in autodeploy: SQL Server 2012, SSDT, and SQLCLR"}]},{"@type":"WebSite","@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/#website","url":"https:\/\/www.sqlskills.com\/blogs\/bobb\/","name":"Bob Beauchemin","description":"SQL Server Blog","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sqlskills.com\/blogs\/bobb\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/#\/schema\/person\/62bfa986c5b5d28fcffd8b4fc409c73e","name":"Bob Beauchemin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/6f80e6cc667410857fa6a21931dc528b8092f4d112bf7a8ff7c267674d44ee37?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6f80e6cc667410857fa6a21931dc528b8092f4d112bf7a8ff7c267674d44ee37?s=96&d=mm&r=g","caption":"Bob Beauchemin"},"sameAs":["http:\/www.sqlskills.com\/blogs\/bobb\/"],"url":"https:\/\/www.sqlskills.com\/blogs\/bobb\/author\/bobb\/"}]}},"_links":{"self":[{"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/posts\/494","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/comments?post=494"}],"version-history":[{"count":0,"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/posts\/494\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/media?parent=494"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/categories?post=494"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/tags?post=494"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}