What's the easiest way to check for the SQL Server Edition and Version using powershell?
相关问题
- SQL join to get the cartesian product of 2 columns
- sql execution latency when assign to a variable
- Difference between Types.INTEGER and Types.NULL in
- How to Debug/Register a Permanent WMI Event Which
- What is the best way to cache a table from a (SQL)
Hacked up advice from this thread (and some others), this went in my psprofile:
All you need is to connect to SQL Server and run this query:
This, of course, will work for any client tool.
Additionally, this is also available:
More ways to determine the SQL Server version here: http://support.microsoft.com/kb/321185
Just an option using the registry, I have found it can be quicker on some of my systems:
Obviously, replace "." with the name of your instance. If you want to see all the methods available, go here.
Here is a version I cobbled together from some sources here and there*.
This version does not hit the registry, does not hit SQL, and doesn't even require that the instance be running. It does require that you know the instance name. If you don't know the instance name, you should be able to trivially work it out from this code.
To get this to work, replace "YourInstanceNameHere" with the name of your instance. Don't touch the
$
if you do it won't work.*I also received help from and help from this this friend of mine https://stackoverflow.com/users/1518277/mqutub and I didn't want it to go uncredited.
Try this
Check all available method to Get the build number of the latest Cumulative Update / Service Pack that has been installed in SQL Server