Link to home
Start Free TrialLog in
Avatar of marrowyung
marrowyung

asked on

MS SQL 2005 sytnax

Dear all,

we have syntax problem by the following statement:

Use yyy;
Update apinpchg set amt_gross = 133.33, amt_net = 470.35, amt_due = 470.35 where trx_ctrl_num = 'DB000381' limit 1;
Update apinpchg set amt_gross = 32613.85, amt_net = 32613.85, amt_due = 32613.85 where trx_ctrl_num = 'DB000384' limit 1;
update apinpcdt set amt_extended = unit_price where trx_ctrl_num in ('DB000380', 'DB000381', 'DB000384') limit 5;

it seems an MySQL statement it has limit x at the end and this statement is not for MSSQL as I get an error:

Msg 102, Level 15, State 1, Line 2
Incorrect syntax near 'limit'.
Msg 102, Level 15, State 1, Line 3
Incorrect syntax near 'limit'.
Msg 102, Level 15, State 1, Line 4
Incorrect syntax near 'limit'.

so what I  have to do is just remove the limit keyword ?
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

just remove the limit clause...

Use yyy;
Update apinpchg set amt_gross = 133.33, amt_net = 470.35, amt_due = 470.35 where trx_ctrl_num = 'DB000381';

Update apinpchg set amt_gross = 32613.85, amt_net = 32613.85, amt_due = 32613.85 where trx_ctrl_num = 'DB000384';

update apinpcdt set amt_extended = unit_price where trx_ctrl_num in ('DB000380', 'DB000381', 'DB000384') ;
Avatar of marrowyung
marrowyung

ASKER

yeah, done.

So no diff on final result, right?
ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
yeah, got similiar link, we just remove it and run it ! tks,