Script error

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: CC&JM (anonymous_at_discussions.microsoft.com)
Date: 08/03/04


Date: Tue, 3 Aug 2004 09:19:07 -0700

Hello,
Iīve 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īt 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)) = 'Microsoft SQL
Server 7'
 begin
   exec sp_helpsort
 end

else

 begin
  .
  .
  .
 select [Server Name] = @@servername,
        [Server Default Collation] = convert(char
(50),serverproperty('collation'))
 end

Hope that you can help me
Regards



Relevant Pages

  • Re: Discussing 3 different strategies for deleting from multiple tables
    ... I will be using SQL Server but I am riding on top of a third party ... FYI, Account contains around 20K ... >>> This results in one parameterized query followed by two more trips to ...
    (microsoft.public.data.ado)
  • Re: Same Internal Server Error from last two days
    ... I am trying to run a Hello World Perl Script in Apache 2.2. ... But its constantly giving me Internal Server Error.The script ... # have to place corresponding `LoadModule' lines at this location so the ...
    (perl.beginners)
  • using xps eventquery.vbs on win2k server... need a little assistance
    ... This script does not exist in windows2000 (server) but can be made to ... On my test instance, I was able to query the security ... I can query all logs accept the security log (which ...
    (microsoft.public.win2000.security)
  • Re: Efficient coordinated queries??
    ... :-) We are distributing processing over a large server farm -- bringing it back onto the SQL server would probably kill our performance. ... Hitchhiker's Guide to Visual Studio and SQL Server ... A large chunk of it can be brought in with a single query and each row represents an item to process. ... For a hypothetical example consider a customer order database where we need to process through all customers and can bring in a row of customer data as our main query but there are 0..n1 rows of customer order data, 0..n2 rows of customer feedback information, 0..n3 rows of customer discounts available, etc. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Same Internal Server Error from last two days
    ... I am trying to run a Hello World Perl Script in Apache 2.2. ... But its constantly giving me Internal Server Error.The script Runs perfectly fine from the command prompt. ... # This is the main Apache HTTP server configuration file. ... LoadModule actions_module modules/mod_actions.so ...
    (perl.beginners)