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 (894257)



The information in this article applies to:

  • Microsoft SQL Server 2000 Desktop Engine (MSDE)
  • Microsoft SQL Server 2000 Developer Edition
  • Microsoft SQL Server 2000 Enterprise Edition
  • Microsoft SQL Server 2000 Personal Edition
  • Microsoft SQL Server 2000 Standard Edition

Bug #: 473788 (SQL Server 8.0)
SQL Server 8.0:473788

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
back to the top

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 ')'.
back to the top

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 now available from Microsoft, but it is only intended to correct the problem that is described in this article. Only apply it to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next SQL Server 2000 service pack that contains this hotfix.

To resolve this problem immediately, contact Microsoft Product Support Services to obtain the hotfix. For a complete list of Microsoft Product Support Services telephone numbers and information about support costs, visit the following Microsoft Web site:Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.

back to the top

Prerequisites

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

Restart information

You must restart your computer after you apply this hotfix.

back to the top

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.back to the top

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.
back to the top

STATUS

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

back to the top

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

back to the top

Modification Type:MinorLast Reviewed:6/1/2006
Keywords:kbbug kbfix kbHotfixServer kbQFE KB894257 kbAudDeveloper kbAudITPRO