服务器版本 [英] server version
本文介绍了服务器版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要测试,我的脚本是在正确的实例版本下运行的(例如,如果是2005年,则是
)。
我只知道@@ VERSION,但是taht不是吗。有什么建议吗?
I need to test, wheather my scripts run under proper instance version (ie.
if it is 2005).
I only know @@VERSION, but taht''s not it. Any suggestions?
推荐答案
嗨
SERVERPROPERTY函数会给你类似的信息见
http://sqlserver2000.databases.aspfa...m-running.html
John
火球 < fi ****** @ onet.kropka.euwrote in message
news:em ********** @ atlantis.news.tpi.pl ...
Hi
The SERVERPROPERTY function will give you similar information see
http://sqlserver2000.databases.aspfa...m-running.html
John
"fireball" <fi******@onet.kropka.euwrote in message
news:em**********@atlantis.news.tpi.pl...
>我需要测试,我的脚本是在适当的实例版本下运行的(即如果它是2005年的话,
)
我只知道@@ VERSION,但是不是。有什么建议吗?
>I need to test, wheather my scripts run under proper instance version (ie.
if it is 2005).
I only know @@VERSION, but taht''s not it. Any suggestions?
我会尽量让自己更清楚:
我可以在运行时停止我的脚本在错误版本的SqlServer下?
I will try to make myself more clear:
can I stop my script when running under wrong version of SqlServer?
您好
您可以测试您正在使用的版本并使代码以
设置如
如果CAST(左(CAST(SERVERPROPERTY(''productversion'')AS varchar(30)),1)AS
smallint)< 9 GOTO EndofScript
PRINT CAST(左(CAST(SERVERPROPERTY(''productversion'')AS varchar(30)),1)AS
smallint)
EndofScript:
John
" John Bell" < jb ************ @ hotmail.comwrote in message
news:45 ****************** ***** @ news.zen.co.uk ...
Hi
You can test the version you are using and make the code run conditional on
that setting such as
IF CAST(LEFT(CAST(SERVERPROPERTY(''productversion'') AS varchar(30)),1) AS
smallint) < 9 GOTO EndofScript
PRINT CAST(LEFT(CAST(SERVERPROPERTY(''productversion'') AS varchar(30)),1) AS
smallint)
EndofScript:
John
"John Bell" <jb************@hotmail.comwrote in message
news:45***********************@news.zen.co.uk...
嗨
SERVERPROPERTY函数将给出你有类似的信息,请参阅
http://sqlserver2000.databases.aspfa...m-running.html
John
火球 < fi ****** @ onet.kropka.euwrote in message
news:em ********** @ atlantis.news.tpi.pl ...
Hi
The SERVERPROPERTY function will give you similar information see
http://sqlserver2000.databases.aspfa...m-running.html
John
"fireball" <fi******@onet.kropka.euwrote in message
news:em**********@atlantis.news.tpi.pl...
>>我需要测试,我的脚本是在正确的实例版本下运行的(即如果它是2005年的话,
)。
我只知道@@ VERSION,但是不是。有什么建议吗?
>>I need to test, wheather my scripts run under proper instance version (ie.
if it is 2005).
I only know @@VERSION, but taht''s not it. Any suggestions?
这篇关于服务器版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文