What are the strings that define a connection's server version?

  • Thread starter Thread starter Robert Dufour
  • Start date Start date
R

Robert Dufour

If I use Dim Myconn as new sqlclient.connection
Dim srvVer as string
srvVer = MyConn.serverversion

What should I get back as string if I was connected to sql server 2000
(standard full version)
what would I get back if it was sqlserver 2005 (standard full version)
are the returend strings different for the sql server developper editions
and the free versions for both 2000 and 2005?

Where can I find docs on this subject?

Some SQL statements seem to require slightly different syntax in the 2005
over the 2000 ver.
Does the 2005 versions support ALL 2000 SQL syntax or do I need to detect
the version to generate the dynamic sql statements in my vb code to adapt to
the correct version of sql server.

Any help would be greatly appreciated.
Bob
 
From MSDN
(http://msdn2.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.serverversion.aspx):

The version is of the form ##.##.####, where the first two digits are
the major version, the next two digits are the minor version, and the
last four digits are the release version. The string is of the form
major.minor.build, where major and minor are exactly two digits and
build is exactly four digits.

As long as you do not use system tables or views, SQL2005 is backward
compatible with SQL2000.
 
Back
Top