Write a SQL PING tool, published on Xfocus, you can get MS SQL version
Download address: http://www.xfocus.net/tools/200408/795.html
The source code is placed later, refer to the code above http://www.sqlsecurity.com, a little changed, here is more inseparable from SQL research, everyone can go see