Re: OPTIMIZER LOCK HINTS

From: Sa (ksadf_at_sdkaew.org)
Date: 01/11/05


Date: Tue, 11 Jan 2005 14:42:23 +0800

Sorry, I make a stupid mistake.

I rewrite to:

INSERT INTO ACCOUNT
 (ACCOUNTID, ACCOUNT, MAINPHONE, FAX)
  SELECT ACCOUNTID, ACCOUNT, MAINPHONE, FAX
  FROM ACCOUNT_TEMP
 SET @ins_error = @@ERROR

Then this error is got.

"Sa" <ksadf@sdkaew.org> wrote in message
news:%23vV8rT69EHA.3336@TK2MSFTNGP11.phx.gbl...
> Hello,
>
> I am writing a Stored Procedure. In the middle of the stored procedure, I
> have the following code:
>
> :
> :
> BEGIN TRAN dataMigration
>
> -- Insert records to the destination table
> INSERT ACCOUNT
> WITH (ACCOUNTID, ACCOUNT, MAINPHONE, FAX)
> VALUES (SELECT ACCOUNTID, ACCOUNT, MAINPHONE, FAX
> FROM ACCOUNT_TEMP)
> SET @ins_error = @@ERROR
> :
> :
>
> SQL Query Analyzer notified me that I have error for the line of "WITH
> (ACCOUNTID,.....)":
> 'ACCOUNTID' is not a recognized OPTIMIZER LOCK HINTS option.
>
> May I know the meaning of this message? How do I solve this problem?
>
> Thanks a lot.
>
> Sammy
>
>



Relevant Pages

  • OPTIMIZER LOCK HINTS
    ... In the middle of the stored procedure, ... BEGIN TRAN dataMigration ... WITH (ACCOUNTID, ACCOUNT, MAINPHONE, FAX) ... VALUES (SELECT ACCOUNTID, ACCOUNT, MAINPHONE, FAX ...
    (microsoft.public.sqlserver.programming)
  • Re: OPTIMIZER LOCK HINTS
    ... LOCK HINT. ... The correct syntax is: ... INSERT INTO Account(ACCOUNTID, ACCOUNT, MAINPHONE, FAX) ...
    (microsoft.public.sqlserver.programming)
  • Re: pass stored procedure parameters in asp
    ... bettys account and try to execute the procedure. ... you can use the EXECUTE AS statement to test the ... procedure and properties) of voidTran stored procedure and other ... This email account is my spam trap ...
    (microsoft.public.inetserver.asp.general)
  • Re: pass stored procedure parameters in asp
    ... In Management Studio, open a new query window, logging in with the bettys ... account and try to execute the procedure. ... procedure and properties) of voidTran stored procedure and other ...
    (microsoft.public.inetserver.asp.general)
  • Re: SQL Server Agent jobs - The specified @job_name does not exist.
    ... > NETWORK SERVICE as the ASP.NET account. ... > a stored procedure in the database which attempts to use ... > The only way I can get the procedure to execute is by ... > login and cannot be selected as the job owner? ...
    (microsoft.public.sqlserver.security)