0

We are currently referencing these binaries in our .NET assembly:

  • Microsoft.SqlServer.ConnectionInfo 12.0.0.0
  • Microsoft.SqlServer.Management.Sdk.Sfc 12.0.0.0
  • Microsoft.SqlServer.Smo 12.0.0.0

Version 12 of these was originally distributed with SQL Server 2014, which is also version I have currently installed on my development PC and that I test against. Our deployment server, however, has SQL Server 2016 installed (version 13.0.5153.0 exactly). I do not remember how exactly did I deploy same version 12 binaries into GAC on this server, but they are there. As a result, our solution runs fine when deployed, because correct version of binaries is found.

How is it possible, that binaries released for SQL Server 2014 work just fine with SQL Server 2016? Am I introducing possible issue here if I happen to use feature that has changed between (sql) server versions and the libraries I referenced will start throwing exceptions?

masiton
  • 147
  • 2
  • 10
  • 1
    Because the protocol they use to talk to the server is backwards compatible – fredrik Aug 21 '18 at 11:32
  • 1
    they did a surprisingly good job with backwards compatibility here. you won't be able to use API features that were introduced with 2016 recently; you will be able to use any tsql extensions in script and commands (like the beautiful DROP IF EXISTS) – Cee McSharpface Aug 21 '18 at 11:32
  • Thanks. @fredrik response is basically the answer. – masiton Aug 21 '18 at 11:38

1 Answers1

0

SQL Server installs many versions of the same assembly and exact version match is performed. Open GAC and see if assemblies are there:

Many assemblies in GAC

See also this link, especially this sentence:

Multiple copies of assemblies with the same name but different version information can be maintained in the global assembly cache.

TDS protocol used by SQL Server is also backward compatible - see specification.

Paweł Dyl
  • 8,888
  • 1
  • 11
  • 27
  • This is correct, however not an answer to the question I was asking. See fredrik's comment under my question for the answer. – masiton Aug 21 '18 at 11:41