Skip to content

This SQL Server Version (10.0) Is Not Supported

You may receive an error:

Running transformation: Microsoft.SqlServer.Management.Smo.FailedOperationException: SetParent failed for Database ‘XXXX’.  —>
Microsoft.SqlServer.Management.Common.ConnectionFailureException: Failed to connect to server XXXX. —>
Microsoft.SqlServer.Management.Common.ConnectionFailureException: This SQL Server version (10.0) is not supported.

When attempting to connect to a SQL Server 2008 database when working with T4 templates or simply accessing an SQL Server directly using the SQL Server SDK via SMO.

What I found was, my code was attempting to connecting using SQL Server 2005 reference assemblies for connection, and you must ensure that your referencing the correct SQL Server (10.0) 2008 Version assemblies. If this doesn’t sound like your problem, another one could be you are attempting to restore a SQL Server 2008 database onto an SQL Server 2005 instance, this also does not work as it’s not backwards compatible. Try scripting your schema + data instead.

But back on track, for the T4 problem, where you have your assembly import declarations at the top of your template, ensure they look like the following:

<#@ assembly name="Microsoft.SqlServer.ConnectionInfo, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" #>
<#@ assembly name="Microsoft.SqlServer.Smo, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" #>
<#@ assembly name="Microsoft.SqlServer.Management.Sdk.sfc, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" #>
<#@ import namespace="Microsoft.SqlServer.Management.Smo" #>

Hope I can help. This should now compile correctly with the specified version calls.

VN:F [1.9.10_1130]
Rating: 4.5/5 (6 votes cast)
VN:F [1.9.10_1130]
Rating: +3 (from 3 votes)
This SQL Server Version (10.0) Is Not Supported, 4.5 out of 5 based on 6 ratings
Bookmark and Share
kick it on DotNetKicks.com
Shout it

NOW, FOR A WORD FROM OUR SPONSORS

3 Comments

  1. Thanks, you save my life :cool:

    VA:F [1.9.10_1130]
    Rating: 4.0/5 (1 vote cast)
    VA:F [1.9.10_1130]
    Rating: +1 (from 1 vote)
    Posted on 21-Jun-10 at 2:46 pm | Permalink
  2. vikram chavan

    how to resolve microsoft.sqlserver.management.common.connectionfailureexception issue ?? :|

    VA:F [1.9.10_1130]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.10_1130]
    Rating: +1 (from 1 vote)
    Posted on 01-Jul-11 at 4:00 pm | Permalink
  3. Dave S

    This was exactly my problem. I thoughtlessly linked to the wrong version of the smo dlls. Thank you so much for sharing.

    VA:F [1.9.10_1130]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.10_1130]
    Rating: 0 (from 0 votes)
    Posted on 20-Aug-11 at 6:06 am | Permalink

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*

My name is Graham O'Neale and I'm a software architect from Gold Coast, Australia. I am an overtime thinker, full time coder and awake part time in the real world. I have a keen interest in software development, particularly in the realm of programming (C#, ASP.NET, ASP.NET MVC, LINQ (2 SQL), Entity Framework, Silverlight, Blend, WCF, WPF) and a keen interest in the cutting edge and innovation. I have a new found love for design patterns, ALT.NET practices and well crafted software architecture. The purpose of this blog is to express any thoughts, findings, tips and gripes along my travels in the wonderful world of coding and technology...