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 ?
LVL 1
marrowyungSenior Technical architecture (Data)Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
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') ;
marrowyungSenior Technical architecture (Data)Author Commented:
yeah, done.

So no diff on final result, right?
Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
yes, just remove the LIMIT as it's not a correct syntax in MS SQL.

In addition for info, In MS SQL we use TOP instead of LIMIT in MySQL in a SELECT statement.
http://www.w3schools.com/sql/sql_top.asp

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
marrowyungSenior Technical architecture (Data)Author Commented:
yeah, got similiar link, we just remove it and run it ! tks,
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2005

From novice to tech pro — start learning today.