[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

09/10/2007 at 06:53AM PDT, ID: 22817608
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

6.0

Slow SQL SP execution

Asked by pauldonson in Databases Miscellaneous, MS SQL Server

Tags: sp, declare, execution

Another one driving me mad!!!

Why does this stored procedure take up to 20 seconds to run?

create procedure procRebookPerson
      (@Booking_ID int = null,
      @Person_ID int = null,
      @New_Booking_ID int = null,
      @User varchar(3))

with encryption

as

set nocount on

Declare @Check_in_required bit, @Checked_in bit, @Checked_in_by varchar(3), @Checked_in_on datetime, @Job_ID as int

Set @Check_in_required = 1
Set @Checked_in = 0
Set @Checked_in_by = Null
Set @Checked_in_on = Null

Select @Job_ID = Job_ID from TBL_Bookings where Booking_ID = @Booking_ID

Select @Check_in_required = check_in_required from TBL_Jobs where Job_ID = @Job_ID

If @Check_in_required = 0
      begin
      Set @Checked_in = 1
      Set @Checked_in_by = @User
      Set @Checked_in_on = getdate()
      end

INSERT INTO TBL_Placements (
      Office_ID,
      Company_ID,
      Site_ID,
      Job_ID,
      Booking_ID,
      Person_ID,
      Mon_Start,
      Mon_end,
      Tue_start,
      Tue_end,
      Wed_start,
      Wed_end,
      Thu_start,
      Thu_end,
      Fri_start,
      Fri_end,
      Sat_start,
      Sat_end,
      Sun_start,
      Sun_end,
      Pay_rate_standard,
      Pay_rate_overtime,
      Pay_rate_evening,
      Pay_rate_Saturday,
      Pay_rate_Sunday,
      Placement_notes,
      Added_by,
      Added_on,
      Checked_in,
      Checked_in_by,
      Checked_in_on
      )
Select      Office_ID,
      Company_ID,
      Site_ID,
      Job_ID,
      @New_Booking_ID,
      Person_ID,
      Mon_start,
      Mon_end,
      Tue_start,
      Tue_end,
      Wed_start,
      Wed_end,
      Thu_start,
      Thu_end,
      Fri_start,
      Fri_end,
      Sat_start,
      Sat_end,
      Sun_start,
      Sun_end,
      Pay_rate_standard,
      Pay_rate_overtime,
      Pay_rate_evening,
      Pay_rate_Saturday,
      Pay_rate_Sunday,
      Placement_notes,
      @User,
      Getdate(),
      @Checked_in,
      @Checked_in_by,
      @Checked_in_on

from      TBL_Placements where Booking_ID = @Booking_ID and Person_ID = @Person_ID




Sorry it is so long!

All it is doing is creating a new record in TBL_Placements based on an exisitng record and changing a few details, I mean, how long can it take??? lol

Anyway, anything I can check or suggestions please?


Thanks.
[+][-]09/10/07 06:57 AM, ID: 19860977

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/10/07 06:58 AM, ID: 19860980

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/10/07 07:06 AM, ID: 19861037

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/10/07 07:07 AM, ID: 19861053

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/10/07 07:21 AM, ID: 19861135

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/10/07 07:22 AM, ID: 19861145

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/10/07 07:23 AM, ID: 19861154

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/10/07 07:24 AM, ID: 19861160

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/10/07 07:34 AM, ID: 19861224

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/10/07 07:36 AM, ID: 19861241

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/10/07 09:13 AM, ID: 19861988

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/20/07 05:47 AM, ID: 19927792

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Databases Miscellaneous, MS SQL Server
Tags: sp, declare, execution
Sign Up Now!
Solution Provided By: pauldonson
Participating Experts: 5
Solution Grade: B
 
 
[+][-]01/20/08 05:40 AM, ID: 20701045

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-91 / EE_QW_1_20070628