Click here to Skip to main content
15,893,644 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
As per My Hosting Service said, The code with the problem is below:

SQL
SELECT
 [dbo].[Student].[StudentID],
 [dbo].[Student].[StudentName],
 [dbo].[Student].[EnrollmentNo],
 [dbo].[Student].[Address],
 [dbo].[Student].[PCT],
 [dbo].[Student].[BranchCode],
 [dbo].[Branch].[BranchName],
 [dbo].[College].[CollegeName]

FROM [dbo].[Student]
LEFT OUTER JOIN [dbo].[College]
ON [dbo].[College].[CollegeID] = [dbo].[Student].[CollegeID]
LEFT OUTER JOIN [dbo].[Branch]
ON [dbo].[Branch].[BranchID] = [dbo].[Student].[BranchID]
WHERE [dbo].[Student].[EnrollmentNo] = @EnrollmentNo


But I cant understand what the problem is.(is any problem with writing [dbo]. before fields?)

They exactly Said is:
It has come to our attention that your database [DatabaseName] is causing an excessive resource usage problem (CPU or SELF BLOCKING), which is negatively affecting other customer databases hosted on the same SQL server.
Please take steps to optimize your database queries or the database itself via indexing, defragmentation, etc. to increase performance and lessen the impact on the SQL server.
The code with the problem is shown..

What I have tried:

Various Stored Procedure optimization Techniques from Internet.
Posted
Updated 19-Feb-16 2:31am
v2
Comments
dan!sh 19-Feb-16 0:00am    
How do you know it is this query? How many records do these tables have? The query itself looks ok.
Dpk_Patel 19-Feb-16 1:54am    
Thanks for reply. actually there was a mail from the hosting site including this stored procedure part. table may have 10,000 records approximately
dan!sh 19-Feb-16 0:04am    
Also, improve the title for your question. Something like Excessive resource utilization or something else.

1 solution

You'll need to make sure there are proper indexes on the tables. We can't do that for you. We can suggest some but we don't know your data nor your schema so we can't help much.

For example, it's a good idea to have indexes on any fields that you are joining on or using in a where clause.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900