Re: Missing Semicolon Query Error

From: John Spencer (MVP) (spencer4_at_comcast.net)
Date: 09/01/04


Date: Wed, 01 Sep 2004 19:47:38 -0400

I'm not positive, but I think you may have to declare the field list you are
inserting into.

INSERT INTO alumni_profile (ID)
  Values ( NZ(DMax("ID","alumni_profile"),0) + 1 )

I'm guessing on the field name since in one place you put New_ID and in another ID

Rone wrote:
>
> I keep getting the following error when running this SQL inside Access.
>
> "Missing Semicolon at the end of the SQL statement"
>
> Here is my SQL of what I want to do:
>
> INSERT INTO alumni_profile VALUES(New_ID,'First','Last','Phone')
> SELECT Nz(DMax("ID","alumni_profile"),0) + 1 As New_ID;
>
> Basically what I'm wanting to accomplish is to create a new ID for an
> "AutoNumber" field, which is incremented sequentially. When I put an ";" at
> the end I continue to get the same error.
>
> What is going wrong?



Relevant Pages

  • Re: Profiler Bug viewing trace flat file?
    ... Kalen Delaney, SQL Server MVP ... Run this code to create a trace capture of the RPC:Complete event: ... declare @error INT ... Now open the trace file in Profiler and you will see that the Textdata ...
    (microsoft.public.sqlserver.tools)
  • Re: c# oledb - multiple inserts to access (mdb) VERY slow - help!
    ... One query regards direct sql or parameterised quert - ... Are you inserting straight values or are you ... Run a .NET performance profiler to see exactly ... call ExecuteNonQuery on command obj associated to connection. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Performance Issues With Query
    ... SQL Server MVP ... > DECLARE @Timestamp datetime ... > DECLARE @CallEventName varchar ... > UPDATE CallByCallYesterdayFinal SET Script = SUBSTRING(@Destination, ...
    (microsoft.public.sqlserver)
  • Re: MSSQL$SBSMONITORING - problem since KB948110 install
    ... Many many thanks for posting a reply, running the SQL command in SQL ... DECLARE @work_to_do TABLE ( ... , indexid int ... DECLARE curIndexes CURSOR FOR SELECT * FROM @work_to_do ...
    (microsoft.public.windows.server.sbs)
  • Re: Problem with SQL UDF
    ... DECLARE RLIB VARCHAR; ... DECLARE RVAR CHARDEFAULT ' '; ... In SQL reference, I found that, if not explicitly declared in a declare procedure statement, all arguments inside a variable will be considered of type INOUT, so I assumed that should run as is, but it's not. ...
    (comp.sys.ibm.as400.misc)