LLB v2.6
Adapter template
Sql Server 2008
I have seen a couple of old threads where using LLB entities in SQL CLR is mentioned. This approach would save me a lot of time if it works.
I am thinking about creating views each with an instead of update trigger which would have some logic to decide whether to simply continue with the update or add a history row with temporal dates and some row versioning numbers.
I can generate T-SQL for this, but it occurs to me that my LLB project has already got everything I need to do it very efficiently.
I have experimented with getting my LLB dlls into the sql server using CREATE ASSEMBLY ... but I get a dependence on system.windows.forms which prevent this.
Adding system.windows.forms with CREATE ASSEMBLY works, but then I get more problems.
Here is where I have reached:
CREATE ASSEMBLY [System.Windows.Forms] from 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll'
WITH permission_set = UNSAFE
CREATE ASSEMBLY [Temporal.Adapter]
FROM 'D:\Work\Temporal\Adapter\DatabaseGeneric\bin\Debug\Temporal.Adapter.dll'
WITH permission_set = UNSAFE
Which outputs:
Warning: The Microsoft .NET Framework assembly 'system.windows.forms, version=2.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089, processorarchitecture=msil.' you are registering is not fully tested in the SQL Server hosted environment and is not supported. In the future, if you upgrade or service this assembly or the .NET Framework, your CLR integration routine may stop working. Please refer SQL Server Books Online for more details.
Warning: The Microsoft .NET Framework assembly 'system.drawing, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a, processorarchitecture=msil.' you are registering is not fully tested in the SQL Server hosted environment and is not supported. In the future, if you upgrade or service this assembly or the .NET Framework, your CLR integration routine may stop working. Please refer SQL Server Books Online for more details.
Warning: The Microsoft .NET Framework assembly 'accessibility, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a, processorarchitecture=msil.' you are registering is not fully tested in the SQL Server hosted environment and is not supported. In the future, if you upgrade or service this assembly or the .NET Framework, your CLR integration routine may stop working. Please refer SQL Server Books Online for more details.
Warning: The Microsoft .NET Framework assembly 'system.runtime.serialization.formatters.soap, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a, processorarchitecture=msil.' you are registering is not fully tested in the SQL Server hosted environment and is not supported. In the future, if you upgrade or service this assembly or the .NET Framework, your CLR integration routine may stop working. Please refer SQL Server Books Online for more details.
Msg 10301, Level 16, State 1, Line 5
Assembly 'Temporal.Adapter' references assembly 'system.design, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a.', which is not present in the current database. SQL Server attempted to locate and automatically load the referenced assembly from the same location where referring assembly came from, but that operation has failed (reason: 2(failed to retrieve text for this error. Reason: 15105)). Please load the referenced assembly into the current database and retry your request.
I guess it would be really useful if someone with more knowledge of this than me could tell me whether I am wasting my time or not.