Re: Stored Procedure: Insert VS Update

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Then I would go with the single join in the expectation that it is the best answer.

If performance problems surface later, then check the execution plans, analyze why, and choose a course that addresses the particular problems that you find.

All the best,
RLF

"eighthman11" <rdshultz@xxxxxxxxxx> wrote in message news:90a43fa5-fc20-49ce-988c-fb12ab773efb@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Jul 29, 2:29 pm, "Russell Fields" <russellfie...@xxxxxxxxxx> wrote:
Ray,

The answer is: "It depends".

Assuming that the tables that you need to join are all well-indexed for the
joins you need to include in this worktable, then doing it once is more
efficient than making several passes doing updates.

I have seen times where am insert followed by a couple of updates ran more
quickly than the full join, but that was because of design and indexing
problems, or because early versions of SQL Server did not optmize as well at
the more current versions. (But you are not on a pre-SQL Server 2000
version are you?)

FWIW,
RLF

"eighthman11" <rdshu...@xxxxxxxxxx> wrote in message

news:0e3db150-70d6-49ac-8fb8-6eb2b4aef4ce@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx



> Hello everyone,

> Against my better judgement I have been thrust into the duty of
> creating Crystal reports for my company. I have discovered rather
> quickly that I also need to become familar with SQL (creating views
> and stored procedures).

> Quick question.
> I have a stored procedure were I created a workfile. Several thousand
> records get inserted in this work file. Is it normally quicker to
> join all the tables I need for the insert or is it faster to get all
> the base records inserted into the workfile then do one or more
> updates to the workfile using the other tables that I didn't join.

> Any help appreciated

> Thanks Ray- Hide quoted text -

- Show quoted text -

Thanks for the reply:
All the tables are indexed very efficiently and we are on SQL Server
2008

.



Relevant Pages

  • Re: NEED TO CALL AS400 S.P
    ... The stored procedure doesn't return any records as it only does inserts and updates. ... I have been unsuccessfully trying to devise a method to 'fool' the OPENQUERY. ... > example is when you call a stored procedure on SQL Server that creates ...
    (microsoft.public.data.oledb)
  • Re: Stored Procedure: Insert VS Update
    ... I have seen times where am insert followed by a couple of updates ran more ... I have a stored procedure were I created a workfile. ... All the tables are indexed very efficiently and we are on SQL Server ...
    (microsoft.public.sqlserver.olap)
  • Re: Stored Procedure: Insert VS Update
    ... Assuming that the tables that you need to join are all well-indexed for the joins you need to include in this worktable, then doing it once is more efficient than making several passes doing updates. ... I have seen times where am insert followed by a couple of updates ran more quickly than the full join, but that was because of design and indexing problems, or because early versions of SQL Server did not optmize as well at the more current versions. ... I have a stored procedure were I created a workfile. ...
    (microsoft.public.sqlserver.olap)
  • pass parameter to sql server view
    ... You can use a stored procedure to make changes. ... I am using Access 2000 and SQL Server 2000, ... >I have a access project front end to a sql server ... problem is that the user need to make updates to the ...
    (microsoft.public.access.forms)
  • Re: Cannot update
    ... not install the updates you referred to. ... highly recommend way for the later one is to install SQL server, ... Microsoft CSS Online Newsgroup Support ...
    (microsoft.public.windows.server.sbs)