Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Problems connecting to SQL Server 2012 using 2005 SMO Expand / Collapse
Author
Message
Posted Tuesday, April 23, 2013 11:37 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, December 12, 2014 8:34 AM
Points: 7, Visits: 270
Should 2005 SMO be able to access SQL 2012 please?

We are currently performing a large migration to SQL Server 2012. It's been going well, but we have hit a problem testing an app. An app server is throwing an exception "This SQL Server version (11.0) is not supported". On further investigation an internal library (used potentially in a number of places) is found to be using Microsoft.SqlServer.ConnectionInfo 9.0.242.0.

Testing seems to show that referencing a later library works.
 
Is this expected behaviour that 2005 SMO library can't access SQL 2012?
 
What are our options - the dev teams are nervous of installing a later version and changing this internal library to reference it (although tests have shown this works). Any simple ways around it?
 
regards
Post #1445769
Posted Friday, April 26, 2013 3:43 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Yesterday @ 6:03 AM
Points: 2,900, Visits: 3,301
Yes, it is expected that SQL 2005 SMO will have problems connecting to SQL 2012. You need to upgrade to a newer version.

Original author: SQL Server FineBuild 1-click install and best practice configuration of SQL Server 2014, 2012, 2008 R2, 2008 and 2005. 18 October 2014: now over 31,000 downloads.
Disclaimer: All information provided is a personal opinion that may not match reality.
Concept: "Pizza Apartheid" - the discrimination that separates those who earn enough in one day to buy a pizza if they want one, from those who can not.
Post #1446877
Posted Sunday, September 1, 2013 7:08 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Today @ 11:42 AM
Points: 1,405, Visits: 373
Hello,

You may have at least 2 problems when you are writing a SMO application :
1- between 2 SMO versions , you can discover that classes may change of namespaces ( the 1st well-known example is the Backup class which has changed its namespace )
2- another problem which is annoying when you are using a SMO application built on a former version of SMO ( for example 2005 ) against a latter version of SQL Server ( 2008 R2 or 2012 ) is appearing with the use of enumerations of which the number of values has changed ( mainly increasing for the latter version , but it seems it was the contrary for at least 1 enumeration in the Smo.Wmi namespace )

In theory , an application written with SMO 2012 is working in 99% of cases against any version of SQL Server ( at least >= 2000 ). But the payload may be heavy as you have for each SMO namespace to set the value of Copy local to true in your Visual Studio with the consequence that the executable will be huger than for the classical way : the referenced assembly is copied in the output directory. Advantage : you are not depending of the assemblies existing on the computer on which the application is running.

In practice , you have to maintain your application only for the last version of SQL Server and when a new SQL Server version is released , you have to recompile after having verified whether some classes have not migrated from a namespace to another one.
You have to be prepared that a property existing in the latest version doesn't exist in a former one. The best way is to test whether the property is existing in the current SQL Server and to decide what to do in case of absence of the property.
It is what I am doing in my SMO applications and since 2006 ( SQL Server 2005 SP2 ) , I think I met only 2 problems that I bypassed easily.

Have a nice day
Post #1490456
Posted Sunday, September 1, 2013 11:13 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, December 12, 2014 8:34 AM
Points: 7, Visits: 270
Many thanks
Post #1490468
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse