Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!mx05.eternal-september.org!.POSTED!not-for-mail From: Erland Sommarskog Newsgroups: comp.databases.ms-sqlserver Subject: Re: Purge Utility Date: Thu, 14 Feb 2013 21:00:34 +0100 Organization: Erland Sommarskog Lines: 21 Message-ID: References: <695679d9-3eb9-44c8-a7fb-2e60ef2b8373@googlegroups.com> <41b71981-071e-4070-8dd2-700ec898f02d@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Injection-Info: mx05.eternal-september.org; posting-host="e87282ec96c371b8272e2d14c79930f2"; logging-data="16500"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19//w4pq6GEKUVK1luRdi9G" User-Agent: Xnews/2006.08.24 Mime-proxy/2.1.c.0 (Win32) Cancel-Lock: sha1:Vd25exixGZ2p8CyklX3bajrsUmA= Xref: csiph.com comp.databases.ms-sqlserver:1389 JAW (jwilliam@aglresources.com) writes: >==================================================== > INSERT INTO REP_BUS_DIR_NO_INSTMT_JAW WITH (TABLOCK) SELECT * FROM > TEMP_BUS_DIR_NO_INSTMT_JAW WHERE KY_BA IN (SELECT KY_BA FROM > [CISStagingDB].[dbo].[REP_BILL_ACCT] (nolock) WHERE CD_OFFICE > '079' >==================================================== > Msg 50000, Level 16, State 1, Procedure usp_Purge, Line 144 > Incorrect syntax near '079' When there is a token missing at the end, SQL Server flags the token as the culprit, rather than say EOF or similar as some compilers do. There should be closing parenthesis at the end. -- Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se Links for SQL Server Books Online: SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx