SQL Server Performance

Execute a script based on SQL Server version?

Discussion in 'Other SQL Server Blogs around the Web' started by Anonymous, Jul 19, 2010.

  1. Anonymous New Member

    Another interesting question &amp; replies on SSP forums lead to this post: Hi, I want to a script based on sql server version year, because some objects are not supported in 2000. We have two enviorments. something like if @@version = 'Microsoft Sqlserver 2000' --do this if @@version ='Microsoft Sqlserver 2008' -- do this ----------------------Reply On the syntax side, just remember that you can use LIKE and wildcards in any string comparison, so you could simply do: IF @@VERSION LIKE 'Microsoft...(<a href="http://sqlserver-qa.net/blogs/t-sql/archive/2010/07/20/9340.aspx">read more</a>)<img src="http://sqlserver-qa.net/aggbug.aspx?PostID=9340" width="1" height="1">

Share This Page