March 28, 2008 at 8:20 am
The TOP syntax works for me if you put the TOP between the UPDATE and the name of the affected table.
As in -
UPDATE Top(@rowsperbatch)
GHOSTDATA
SET
Regjimi = 'MI88'
WHERE
LEFT(NR_KEK,2) IN ('08','07','06') AND
Regjimi != 'MI88'
Same with DELETE by the way.
----------------------------------------------------------------------------------
Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?
March 28, 2008 at 8:22 am
Dugi (3/28/2008)
OK I'm trying but still have problem with these message:...
Incorrect syntax near the keyword 'Top'.
so this is what I'm asking for ...why this incorrect msg!!!??!?!?
thnx
Dugi
Oops, I should have tested it first. The TOP clause is out of order:
CREATE Procedure spGHOSTDATA_IncrementalUpdate( @RowsPerBatch int )
AS
Update Top (@RowsPerBatch) GHOSTDATA
Set Regjimi = 'MI88'
Where Regjimi <> 'MI88'
And NR_KEK >= '06'
And NR_KEK < '09'
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
March 28, 2008 at 8:22 am
Also - I could swear that SET ROWCOUNT was "on its way out", i.e. being deprecated. I will have to see if I can dig that up.
----------------------------------------------------------------------------------
Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?
March 28, 2008 at 8:24 am
March 28, 2008 at 8:25 am
Matt Miller (3/28/2008)
Also - I could swear that SET ROWCOUNT was "on its way out", i.e. being deprecated. I will have to see if I can dig that up.
It is. I mentioned that in one of the earlier posts: BOL says that the "next" release will deprecate its use for everything except SELECT.
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
March 28, 2008 at 8:26 am
Dugi (3/28/2008)
ookkk now works fine ...thnx from all of you !!!
You're welcome, let us know how it works out Dugi.
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
March 28, 2008 at 8:36 am
Hmmm ...it's impossible ok the syntax of the procedure works and has been created but when I execute them both of them again doesn't work there is msg:
Msg 201, Level 16, State 4, Procedure spUpdatepare, Line 0
Procedure or function 'spUpdatepare' expects parameter '@RowsPerBatch', which was not supplied.
as you can see the problem is with parameter " @RowsPerBatch "
so what's now!?
Any idea ???
:w00t:
March 28, 2008 at 8:41 am
Did you set you batch size, when you call call like this
EXEC spUpdatepare 25000
this will affect 25000 records in the batch.
March 28, 2008 at 8:42 am
rbarryyoung (3/28/2008)
Matt Miller (3/28/2008)
Also - I could swear that SET ROWCOUNT was "on its way out", i.e. being deprecated. I will have to see if I can dig that up.It is. I mentioned that in one of the earlier posts: BOL says that the "next" release will deprecate its use for everything except SELECT.
Thanks, hadn't noticed that. Too busy with other things.
March 28, 2008 at 8:45 am
Antares686 (3/28/2008)
Did you set you batch size, when you call call like thisEXEC spUpdatepare 25000
this will affect 25000 records in the batch.
I confused with this problem so I forget that we have input parameter here I'm trying ...and it works now and I'm seeing what happened with time execution !
thnx Antares
March 28, 2008 at 5:04 pm
ok there is the results for my table with over 1 500 000 records:
updateing
25 000 rec for 1:22 (min:sec)
250 000 rec for 7:19
over 500 000 or exactly 676 561 rec for 21:39
there si differences because with simple update it take over 30 min!
NOT BAD!
Dugi
Viewing 11 posts - 16 through 25 (of 25 total)
You must be logged in to reply to this topic. Login to reply