18

We've got a couple of on-premises dbs and we're seeing if we can migrate them to SQL Azure. Some of those dbs have a couple of user defined functions written in C# in an assembly (SAFE). After running a search, I've found a couple of posts which contradict each other. Some say that v12 supports CLR code. Others say it doesn't. So, here are my questions:

  • Does V12 supports embedding clr assemblies?
  • How can we export the generation script for azure with the assembly? Whenever we set the export option to azure we end up getting an error saying that clr user defined functions are not supported in azure.

Thanks guys!

Luis

Jovan MSFT
  • 11,158
  • 4
  • 35
  • 43
Luis Abreu
  • 3,136
  • 4
  • 28
  • 51
  • 1
    "getting an error saying that clr user defined functions are not supported in azure." - one would assume that this answers the question. – TomTom May 20 '16 at 09:10

4 Answers4

15

CLR Functions are not supported in Azure:

Check here:

Azure SQL Database Transact-SQL differences

Under unsupported features it mentions ".NET Framework CLR integration with SQL Server"

I believe there may be some confusion as to whether it does or doesn't support them as they used to in one version, then they removed support.

Here is a link detailing the fact they were supported, but got pulled, apparently due to a security issue:

Breaking News, Literally: SQL CLR Support Removed from Azure SQL DB

steoleary
  • 8,362
  • 2
  • 28
  • 45
  • 4
    The most "official" notice that I have seen is this post on reddit: https://www.reddit.com/r/AZURE/comments/4dtjkt/ama_microsoft_databases_team_48/d1v4nbd – Solomon Rutzky Jul 04 '16 at 05:50
  • 1
    does anyone have any updates on this? That reddit post sort of hinted that support would be brought back in the future. – Moe Sisko Nov 29 '17 at 04:14
  • 1
    does anyone have any updates on this? i was seeing SQL Data Migration video recently https://channel9.msdn.com/Events/Build/2017/P4008, looks like it migrated on premise sql database to azure with clr assembly. – Lalit Dec 12 '17 at 07:58
  • Also, CLR functionality is enabled by defautl on Azure SQL. One can see this just by reading the tSQLt docs and running some tests. The tSQLtCLR assembly loads just fine into non-managed Azure SQL, but many other assemblies don't. – Adam Bezverkov Aug 06 '19 at 20:06
10

Azure SQL support now CLR using Azure SQL managed instance. https://docs.microsoft.com/en-us/azure/sql-database/sql-database-managed-instance-transact-sql-information#clr

Anass Kartit
  • 1,523
  • 10
  • 20
  • 2
    Please don't add the same answer to multiple questions. Answer the best one and flag the rest as duplicates. See [Is it acceptable to add a duplicate answer to several questions?](//meta.stackexchange.com/q/104227/206345) – Goodbye StackExchange Feb 04 '19 at 23:02
3

Using managed instance you can have almost all support benefits of an on premise including C# CLR. To access the instances you have to use SSMS Preview 6 of SQL Server Management Studio 18 or TSQL.

Jautomator
  • 139
  • 1
  • 9
0

You have 2 choices:

  1. Use Azure SQL managed instance (very expensive, more than $1000 per month)
  2. Create an Azure VM and install SQL Server on it (much cheaper, less then $20 per month)
Francesco Mantovani
  • 4,065
  • 3
  • 39
  • 55