locked
an application that will work regardless of SQL server version RRS feed

  • Question

  • Hello !

    Is there a way to make an application that use SMO libraries , to work regardless of SQL server version ?

    I'm referencing the SMO libraries from version  2008R2 , but when I use my application with sql server 2005 or 2012 , doesn't work.

    Is there any solution ?

    Thank you !

    Wednesday, May 27, 2015 9:33 PM

Answers

All replies

  • References to SMO dlls in older versions of SQL Server must be removed, and references to the new SMO dlls that are provided with SQL Server 2014 must be included.

    Minimally, you would reference the following:

    • Microsoft.SqlServer.ConnectionInfo

    • Microsoft.SqlServer.Smo

    • Microsoft.SqlServer.Management.Sdk.Sfc

    These files are required for connection classes, SMO utility classes, and foundation classes.

    https://msdn.microsoft.com/en-us/library/dd206977.aspx?f=255&MSPPError=-2147217396

    Thursday, May 28, 2015 2:15 AM
  • References to SMO dlls in older versions of SQL Server must be removed, and references to the new SMO dlls that are provided with SQL Server 2014 must be included.

    Minimally, you would reference the following:

    • Microsoft.SqlServer.ConnectionInfo

    • Microsoft.SqlServer.Smo

    • Microsoft.SqlServer.Management.Sdk.Sfc

    These files are required for connection classes, SMO utility classes, and foundation classes.

    https://msdn.microsoft.com/en-us/library/dd206977.aspx?f=255&MSPPError=-2147217396

    So if I reference the new SMO 2014 files , my application will work with all version of sql server  ? ( version 2005-2014) ? Is this correct ? All the SMO functions will work with any sql server version ?

    Thank you !

    Thursday, May 28, 2015 2:31 AM
  • Hello,

    SMO is backward compatible over several version, but not over all. Yes, SMO for SQL Server 2014 will work with SQL Server 2005, but not with e.g. 2000.


    Olaf Helper

    [ Blog] [ Xing] [ MVP]

    Thursday, May 28, 2015 7:21 AM
  • Hello,

    SMO is backward compatible over several version, but not over all. Yes, SMO for SQL Server 2014 will work with SQL Server 2005, but not with e.g. 2000.


    Olaf Helper

    [ Blog] [ Xing] [ MVP]

    I need compatibility only with 2005 , 2008 , 2008R2 , 2012 , 2014.

    In these versions , if I use SMO 2014 , all the SMO functions will work ?

    Thursday, May 28, 2015 7:38 AM
  • Yes, with SMO 2014 it will work.

    Olaf Helper

    [ Blog] [ Xing] [ MVP]

    • Proposed as answer by Papy Normand Wednesday, June 3, 2015 10:29 PM
    • Marked as answer by Eric__Zhang Monday, June 8, 2015 1:59 AM
    Thursday, May 28, 2015 7:51 AM