How do I find the SQL Server Version through Nav Client code
mcoAggie
Member Posts: 23
Does anyone know an easy method to find the SQL Server version from within the Nav client?
I want to find out which db versions our clients are on because this is going to become more of an issue. I would like to be able to do this without knowing another connection string or at least use the same one as finsql.exe is using.
I want to find out which db versions our clients are on because this is going to become more of an issue. I would like to be able to do this without knowing another connection string or at least use the same one as finsql.exe is using.
Owen McDonald
http://www.archerpoint.com
http://www.archerpoint.com
0
Comments
-
Hi,
@version' which returns a string which includes the version of the sql server.
There is info in the net that tell you which version any version code actually is.
I include a code sample:autSQLServer Automation 'Microsoft SQLDMO Object Library'.SQLServer res Automation 'Microsoft SQLDMO Object Library'.QueryResults autDatabases Automation 'Microsoft SQLDMO Object Library'.Databases autDB Automation 'Microsoft SQLDMO Object Library'.Database //connect to server CREATE(autSQLServer); autSQLServer.Connect(ServerName, Username, Password); //find the desired database in the collection autDatabases := autSQLServer.Databases; i:=1; Found := FALSE; WHILE (i <= autDatabases.Count) AND (NOT Found) DO BEGIN autDB := autDatabases.ItemByID(i); DBName := autDB.Name; IF DBName = 'master' THEN Found := TRUE; i:=i+1; END; //execute a query res:=autDB.ExecuteWithResults('select @@version'); MESSAGE(res.GetColumnString(1,1)); //disconnect from the server and clear all vars autSQLServer.DisConnect; autSQLServer.Close; CLEARALL;
This is some code I have written some time ago for test...0 -
Additionaly you could get the server name which you are connected by using the server record and filter with "My Server" TRUE.
You can find better sql statements and info about the actual sql server versions here:
http://support.microsoft.com/kb/3211850 -
Thanks Arhonits,
This helps.
I wanted to give a way for our help desk to update our CRM info without too much trouble. It would be nice if there was a virtual table that stored the connection information.
I may just write something to check the servers and the authorization mode and allow the user to update the connection on the request form.Owen McDonald
http://www.archerpoint.com0 -
Can't you just call the function in CU 1?David Singleton0
-
David Singleton wrote:Can't you just call the function in CU 1?
Could you explain?0 -
David Singleton wrote:Can't you just call the function in CU 1?
Please ignore this, I miss read the question :oops:David Singleton0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions


