Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sp_server_info & @@version differences

Status
Not open for further replies.

Ambientguitar

Programmer
Apr 23, 2006
31
GB
Hi hope someone can enlighten me , I am writting a little utilty for our support guys. On one of the forms I wanted to display the SQl version running on remote so I ran @@version into a cursor and that came up with (Build 2195:service Pack 4) But when I tried the same running Sp_server_info it came back with (Build 2195:service Pack 2) Can anyone enlighten me is this a SQL server 2000 bug or what?
 
sp_server_info reads information out of the spt_server_info table in the master database. This table should be updated when installing a service pack, etc. Apparantly this is not correctly done.

@@version calls an extended stored procedure master.dbo.xp_msver. This checks the version of files installed.

By choice is to always use @@version, since this returns the accurate version.

Best regards,

G.I.
 
Thanks a million just needed verification as to which to use, I now have to strip out the unwanted characters lol!
 
Have you ever tried ServerProperty?

Code:
SELECT ServerProperty('Edition'),
       ServerProperty('ProductLevel'),
       ServerProperty('ProductVersion')

Those are three that I use often. There are more options, such as License. Refer to the BOL for more information on ServerProperty.

-SQLBill

Posting advice: FAQ481-4875
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top