Showing posts with label verify. Show all posts
Showing posts with label verify. Show all posts

Monday, March 26, 2012

Script to find out what Edition of SQL Server is installed

Does anyone have a quick script or method to verify the edition that is inst
alledHi,
Execute the below statement from Query Analyzer,
Select @.@.version
Thanks
Hari
MCDBA
"Glenn Wilson" <anonymous@.discussions.microsoft.com> wrote in message
news:A7DB397B-B431-47A8-8B43-7598EC5140BB@.microsoft.com...
> Does anyone have a quick script or method to verify the edition that is
installed|||http://www.aspfaq.com/2160
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"Glenn Wilson" <anonymous@.discussions.microsoft.com> wrote in message
news:A7DB397B-B431-47A8-8B43-7598EC5140BB@.microsoft.com...
> Does anyone have a quick script or method to verify the edition that is
installed|||Found it, FYI
SELECT SERVERPROPERTY('productversion'),
SERVERPROPERTY ('productlevel'),
SERVERPROPERTY ('edition')

Script to find out what Edition of SQL Server is installed

Does anyone have a quick script or method to verify the edition that is installedHi,
Execute the below statement from Query Analyzer,
Select @.@.version
Thanks
Hari
MCDBA
"Glenn Wilson" <anonymous@.discussions.microsoft.com> wrote in message
news:A7DB397B-B431-47A8-8B43-7598EC5140BB@.microsoft.com...
> Does anyone have a quick script or method to verify the edition that is
installed|||http://www.aspfaq.com/2160
--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"Glenn Wilson" <anonymous@.discussions.microsoft.com> wrote in message
news:A7DB397B-B431-47A8-8B43-7598EC5140BB@.microsoft.com...
> Does anyone have a quick script or method to verify the edition that is
installed|||Found it, FY
SELECT SERVERPROPERTY('productversion')
SERVERPROPERTY ('productlevel')
SERVERPROPERTY ('edition'

Friday, March 9, 2012

Script error

Hello,
I=B4ve done one script where i verify the sql server version and the output return the corresponding collations. First is checked if the version is "SQL Server 7.0" and if it is executes sp_helpsort, if it isn=B4t SQL 7.0 there are a lot of steps and one query where is referenced the serverproperty('collation').
The problem is that im trying this and the following error is returned:
"Server: Msg 195, Level 15, State 10, Line 2
'serverproperty' is not a recognized function name"
but if i comment the query the script runs without any problem.
How is this possible? It should not be possible that this part of the script were checked since the @.@.version of the server is 7.0 and so theres no nedd to check the else statement
I cant understand, down i write a coople of lines used in the script.
if (select substring(@.@.version,1,23)) =3D 'Microsoft SQL Server 7'
begin
exec sp_helpsort end
else
begin
.
.
.
select [Server Name] =3D @.@.servername, [Server Default Collation] =3D convert(char
(50),serverproperty('collation')) end
Hope that you can help me
RegardsThe serverproperty function is only available in 2000 if I'm not mistaken. SP_server_info will return the collation under 7.0.
>--Original Message--
>Hello,
>I=B4ve done one script where i verify the sql server version >and the output return the corresponding collations. First >is checked if the version is "SQL Server 7.0" and if it is >executes sp_helpsort, if it isn=B4t SQL 7.0 there are a lot >of steps and one query where is referenced the >serverproperty('collation').
>The problem is that im trying this and the following error >is returned:
>"Server: Msg 195, Level 15, State 10, Line 2
>'serverproperty' is not a recognized function name"
>but if i comment the query the script runs without any >problem.
>How is this possible? >It should not be possible that this part of the script >were checked since the @.@.version of the server is 7.0 and >so theres no nedd to check the else statement
>I cant understand, down i write a coople of lines used in >the script.
>if (select substring(@.@.version,1,23)) =3D 'Microsoft SQL >Server 7'
> begin
> exec sp_helpsort > end
>else
> begin
> .
> .
> .
> select [Server Name] =3D @.@.servername, > [Server Default Collation] =3D convert(char
>(50),serverproperty('collation')) > end
>Hope that you can help me
>Regards
>.
>