July 13, 2012 at 9:22 am
Start a project on my Dev Server.
SQL 2012 with CU1 and CU2 are installed on both Coding Server and Dest Server
Start project on Dev server.
Pick vb.net CLR project type
name project something random...
setup connection to destination server/database
Use .net framework 4.0 (installed on both servers and verified the framework is the same version)
To verify framework SQL 2012 is using I ran this command on the Dest server:
select * from sys.dm_clr_properties
Results:
directoryC:\Windows\Microsoft.NET\Framework64\v4.0.30319\
versionv4.0.30319
stateCLR is initialized
Verified the Database I'm deploying to has Trustworthy set to ON
added a Stored procedure to the project.
Did not add any code to the stored procedure.
Build the project (successful)
Deploy the project I get:
SqlClrDeploy:
Beginning deployment of assembly TestCLRProject.dll to server OLTP : MyDatabase
The following error might appear if you deploy a SQL CLR project that was built for a version of the .NET Framework that is incompatible with the target instance of SQL Server: "Deploy error SQL01268: CREATE ASSEMBLY for assembly failed because assembly failed verification". To resolve this issue, open the properties for the project, and change the .NET Framework version.
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\TeamData\Microsoft.Data.Schema.SqlClr.targets(96,5): Deploy error SQL01234: The database version is not supported.
Build FAILED.
Time Elapsed 00:00:00.01
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========
Anybody have any ideas?
July 13, 2012 at 9:37 am
Nevermind.
I just found that VS 2010 SP1 doesn't work properly with SQL 2012 CLR.
You have to install this overtop of your VS 2010 SP1 installation:
http://msdn.microsoft.com/en-us/data/hh297027
What's weird is that my Dev server ALREADY had SQL Data Tools installed ???!!?!?
July 15, 2012 at 8:18 am
cARBONc (7/13/2012)
Nevermind.What's weird is that my Dev server ALREADY had SQL Data Tools installed ???!!?!?
If you didn't have SSDT installed on the machine you created the CLR procedure on it wouldn't have been compiled against the correct binaries.
Another thing you might run into with CLR fro SQL Server is that a lot of the new features in the .NET Framework 4.0 are not tested against SQL Server 2012. If you try to use one of the untested assemblies you'll get a warning (maybe an error, I forget which) when you try to deploy it.
[font="Tahoma"]Bryant E. Byrd, BSSE MCDBA MCAD[/font]
Business Intelligence Administrator
MSBI Administration Blog
April 16, 2014 at 1:52 pm
Why does the MS documentation say you can do it with visual studio?
April 16, 2014 at 2:39 pm
Shon Thompson (4/16/2014)
Why does the MS documentation say you can do it with visual studio?
You can deploy a CLR object to SQL Server from Visual Studio as long as you have permission and all the versions are compatible. The TechNet article isn't very clear on what those version requirements are.
[font="Tahoma"]Bryant E. Byrd, BSSE MCDBA MCAD[/font]
Business Intelligence Administrator
MSBI Administration Blog
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply