FIX: You receive an "Incorrect syntax near ')'" error message when you run a script that was generated by SQL-DMO for an Operator object in SQL Server 2000

Article translations Article translations
Article ID: 894257 - View products that this article applies to.
Bug #: 473788 (SQL Server 8.0)
Expand all | Collapse all

On This Page

Article contents

Summary

This article describes the following about this hotfix release:
  • The issues that are fixed by this hotfix package
  • The prerequisites for installing the hotfix package
  • Whether you must restart your computer after you install the hotfix package
  • Whether the hotfix package is replaced by any other hotfix package
  • Whether you must make any registry changes
  • The files that are contained in the hotfix package

Symptoms

In Microsoft SQL Server 2000, when you try to run a script that was generated by SQL- Distributed Management Objects (DMO) for an Operators object or an Operator object, you may receive an error message that is similar to the following:
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near ')'.

Cause

This problem occurs when the SQLDMOScript_Drops option is enabled. When the SQLDMOScript_Drops option is enabled, the generated script includes an additional parenthesis (" ( ").

For a list of previous hotfixes, see the "Microsoft SQL Server 2000 post-Service Pack 3 or Microsoft SQL Server 2000 post-Service Pack 3a hotfixes" section in the following Microsoft Knowledge Base article:
810185 SQL Server 2000 hotfix update for SQL Server 2000 Service Pack 3 and 3a

Resolution

Hotfix information

A supported hotfix is available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing this specific problem.

If the hotfix is available for download, there is a "Hotfix download available" section at the top of this Knowledge Base article. If this section does not appear, submit a request to Microsoft Customer Service and Support to obtain the hotfix.

Note If additional issues occur or if any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. For a complete list of Microsoft Customer Service and Support telephone numbers or to create a separate service request, visit the following Microsoft Web site:
http://support.microsoft.com/contactus/?ws=support
Note The "Hotfix download available" form displays the languages for which the hotfix is available. If you do not see your language, it is because a hotfix is not available for that language.

Prerequisites

You must have SQL Server 2000 Service Pack 3a and Hotfix 1007 for SQL Server 2000 installed to apply this hotfix.

Restart information

You must restart your computer after you apply this hotfix.

Hotfix file information

This hotfix contains only those files that are required to correct the issues that this article lists. This hotfix may not contain all the files that you must have to fully update a product to the latest build.

The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.
   Date      	Time   Version         Size        File name
   --------------------------------------------------------------------
   16-Feb-2005  20:09  2000.80.1009.0     664,128  Autoplt.dll      
   16-Feb-2005  20:09  2000.80.1009.0      78,400  Console.exe      
   16-Feb-2005  20:09  2000.80.1009.0     332,352  Ctasksui.dll     
   16-Feb-2005  20:09  2000.80.1009.0     315,968  Custtask.dll     
   16-Feb-2005  20:09  2000.80.1009.0      33,340  Dbmslpcn.dll     
   31-Dec-2004  19:31                     786,432  Distmdl.ldf
   31-Dec-2004  19:31                   2,359,296  Distmdl.mdf
   31-Dec-2004  19:31                         180  Drop_repl_hotfix.sql
   16-Feb-2005  20:09  2000.80.1009.0   1,905,216  Dtspkg.dll       
   16-Feb-2005  20:09  2000.80.1009.0     528,960  Dtspump.dll      
   16-Feb-2005  20:09  2000.80.1009.0   1,557,052  Dtsui.dll        
   16-Feb-2005  20:09  2000.80.1009.0     639,552  Dtswiz.dll       
   31-Dec-2004  19:31                     747,927  Instdist.sql
   31-Dec-2004  19:31                       1,581  Inst_repl_hotfix.sql
   16-Feb-2005  20:09  2000.80.1009.0     352,828  Isqlw.exe        
   16-Feb-2005  20:09  2000.80.1009.0      82,492  Itwiz.exe        
   16-Feb-2005  20:09  2000.80.1009.0      90,692  Msgprox.dll      
   31-Dec-2004  19:16  8.11.41022.0       226,304  Mssdi98.dll      
   16-Feb-2005  20:09  2000.80.1009.0      62,024  Odsole70.dll     
   16-Feb-2005  20:09  2000.80.1009.0      25,144  Opends60.dll     
   16-Feb-2005  20:12                      82,944  Opends60.pdb
   16-Feb-2005  20:09  2000.80.1009.0      57,904  Osql.exe         
   16-Feb-2005  20:09  2000.80.1009.0     279,104  Pfutil80.dll     
   01-Feb-2005  01:46                     551,012  Procsyst.sql
   31-Dec-2004  19:31                      12,305  Qfe469315.sql
   31-Dec-2004  19:31                      19,195  Qfe469571.sql
   31-Dec-2004  19:31                       5,157  Qfe472197.sql
   16-Feb-2005  20:09  2000.80.1009.0     143,940  Qrdrsvc.exe      
   16-Feb-2005  19:03                   1,136,160  Replmerg.sql
   16-Feb-2005  20:09  2000.80.1009.0     221,768  Replprov.dll     
   16-Feb-2005  20:09  2000.80.1009.0     307,784  Replrec.dll      
   16-Feb-2005  19:09  2000.80.1009.0     159,813  Replres.rll
   31-Dec-2004  19:31                   1,088,240  Replsys.sql
   14-Jan-2005  01:05                     986,746  Repltran.sql
   31-Dec-2004  18:49                          55  Repl_uninstall.sql
   16-Feb-2005  20:09  2000.80.1009.0     287,304  Rinitcom.dll     
   16-Feb-2005  20:09  2000.80.1009.0      78,416  Sdiclnt.dll      
   16-Feb-2005  20:09  2000.80.1009.0      66,112  Semmap.dll       
   16-Feb-2005  20:09  2000.80.1009.0      57,916  Semnt.dll        
   16-Feb-2005  20:09  2000.80.1009.0     492,096  Semobj.dll       
   16-Feb-2005  19:37  2000.80.1009.0     172,032  Semobj.rll
   16-Feb-2005  20:09  2000.80.1009.0      53,832  Snapshot.exe     
   01-Feb-2005  01:46                     125,540  Sp3_serv_uni.sql
   16-Feb-2005  20:09  2000.80.1009.0      28,672  Sqlagent.dll     
   16-Feb-2005  20:09  2000.80.1009.0     311,872  Sqlagent.exe     
   16-Feb-2005  20:09  2000.80.1009.0     168,001  Sqlakw32.dll     
   16-Feb-2005  20:09  2000.80.1009.0      33,344  Sqlctr80.dll     
   16-Feb-2005  20:09  2000.80.1009.0   4,215,360  Sqldmo.dll       
   16-Feb-2005  20:09                      25,172  Sqldumper.exe    
   16-Feb-2005  19:02  2000.80.1009.0      28,672  Sqlevn70.rll
   16-Feb-2005  20:09  2000.80.1009.0     156,224  Sqlmaint.exe     
   16-Feb-2005  20:09  2000.80.1009.0     180,792  Sqlmap70.dll     
   16-Feb-2005  20:09  2000.80.1009.0     188,992  Sqlmmc.dll       
   16-Feb-2005  19:32  2000.80.1009.0     479,232  Sqlmmc.rll
   16-Feb-2005  20:09  2000.80.1009.0     401,984  Sqlqry.dll       
   16-Feb-2005  20:09  2000.80.1009.0      57,920  Sqlrepss.dll     
   16-Feb-2005  20:09  2000.80.1009.0   7,721,041  Sqlservr.exe     
   16-Feb-2005  20:12                  13,345,792  Sqlservr.pdb
   16-Feb-2005  20:09  2000.80.1009.0     590,396  Sqlsort.dll      
   16-Feb-2005  20:09  2000.80.1009.0      45,644  Sqlvdi.dll       
   16-Feb-2005  20:09  2000.80.1009.0     106,588  Sqsrvres.dll     
   16-Feb-2005  20:09  2000.80.1009.0      33,340  Ssmsgnet.dll     
   16-Feb-2005  20:09  2000.80.1009.0      33,340  Ssmslpcn.dll     
   16-Feb-2005  20:09  2000.80.1009.0      33,340  Ssmsqlgc.dll     
   16-Feb-2005  20:09  2000.80.1009.0      82,492  Ssnetlib.dll     
   16-Feb-2005  20:09  2000.80.1009.0      25,148  Ssnmpn70.dll     
   16-Feb-2005  20:09  2000.80.1009.0     123,456  Stardds.dll      
   16-Feb-2005  20:09  2000.80.1009.0     158,240  Svrnetcn.dll     
   16-Feb-2005  20:09  2000.80.1009.0      76,416  Svrnetcn.exe     
   16-Feb-2005  20:09  2000.80.1009.0      49,228  Ums.dll          
   16-Feb-2005  20:12                     132,096  Ums.pdb
   16-Feb-2005  20:09  2000.80.1009.0      74,304  Xplog70.dll      
   16-Feb-2005  20:09  2000.80.1009.0      98,872  Xpweb70.dll      
Note Because of file dependencies, the most recent hotfix that contains these files may also contain additional files.

Workaround

To work around this issue, generate the script by using Enterprise Manager instead of by using the SQL-DMO code. To create a script in Enterprise Manager, follow these steps:
  1. Start Enterprise Manager.
  2. Expand Microsoft SQL Server, expand SQL Server Group, expand your server, expand Management, and then expand SQL Server Agent.
  3. Right-click Operators, point to All Tasks, and then click Generate SQL Script.
  4. In the File name box, type a file name for your script.
  5. Under File format, click a file format.
  6. Under SQL generation options, click to select the check boxes or click to clear the check boxes for the options that you want.
  7. In the TSQL batch separator box, type a Transact-SQL batch separator.
  8. Click OK.

Status

Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.

More information

Steps to reproduce the behavior

  1. Create a new operator on your SQL Server-based server.
  2. Start SQL Query Analyzer to connect to your SQL Server and then run the following scripts:
    DECLARE @cmd varchar(255) -- Command to run 
    DECLARE @oSQLServer int -- OA return object 
    DECLARE @hr int -- Return code
    DECLARE @Server varchar(30) -- Server name to run script on. By default, local server.
    
    EXEC @hr = sp_OACreate 'SQLDMO.SQLServer', @oSQLServer OUT
    EXEC @hr = sp_OASetProperty @oSQLServer, 'LoginSecure', TRUE
    EXEC @hr = sp_OAMethod @oSQLServer,'Connect',NULL,@server
    
    SET @cmd = 'Jobserver.Operators.Script(327,"c:\Create_Operators.sql",3074)'
    select @cmd
    EXEC @hr = sp_OAMethod @oSQLServer, @cmd
    EXEC @hr = sp_OAMethod @oSQLServer, 'Disconnect'
    exec sp_OADestroy @oSQLServer
  3. The script in step 2 generates a script file that is named Create_Operators.sql on the computer that is running SQL Server. Open the script file to view the generated scripts.
For more information about the naming schema for SQL Server updates, click the following article number to view the article in the Microsoft Knowledge Base:
822499 New naming schema for Microsoft SQL Server software update packages
For more information about the terminology that Microsoft uses when it corrects software after it is released, click the following article number to view the article in the Microsoft Knowledge Base:
824684 Description of the standard terminology that is used to describe Microsoft software updates

Properties

Article ID: 894257 - Last Review: June 20, 2014 - Revision: 3.0
Applies to
  • Microsoft SQL Server 2000 Developer Edition
  • Microsoft SQL Server 2000 Enterprise Edition
  • Microsoft SQL Server 2000 Personal Edition
  • Microsoft SQL Server 2000 Standard Edition
Keywords: 
kbautohotfix kbbug kbfix kbhotfixserver kbqfe KB894257

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com