Here is a very basic question I just came across the other day. I was interviewing nearly 20 candidates and I found that only 5 of them could write the query (with the help of the internet).
Question: How to determine the version and properties of SQL Server with the help of T-SQL?
Answer: Here is the simple script which can list version of SQL Server:
SELECT SERVERPROPERTY('productversion') ProductVersion,
SERVERPROPERTY ('productlevel') ProductLevel,
SERVERPROPERTY ('edition') Edition
Reference: Pinal Dave (https://blog.sqlauthority.com)
SELECT @@Version gives similar results .. whats the difference between these two ?
The difference is that you need to parse the result of @@version to get details in specific
Is the instruction @@VERSION a valid answer? Like in SELECT @@VERSION.
Everton – As madhivanan said, you need to parse results if you want to use in subsequent queries.
As an interviewer I find questions like these not as useful as finding out if the candidate can use available tools to answer the question. Tools including Google. What is the point of hiring someone that can wow you in an interview then in real life can’t solve simple real world problems.
What’s wrong with Select @@Version?
Robb – Nothing wrong with @@version. If you want to use the exact build into your script to take any action then you need to parse the output of @@version and find required info like edition etc.
i enjoying learning Through Your usefull Blogs . Sir You Doing A great Job