SQL SCRIPT
-
Hi Guys, I am having problem when running the Following SQL script.It takes Pretty long time to return result. I am having about 500,000 records in my database. select count(distinct(CR_Cli)),SO_name from Callrecords inner join dbo.StudioOperators On CR_StudioOperatorID=SO_ID where datename(month,cr_callstart)='April' and Cr_cli not in (select Cr_cli from Callrecords where cr_callstart<'2009-03-31') group by SO_name desc Is there any way i can write this script? Thanks you very much.
-
Hi Guys, I am having problem when running the Following SQL script.It takes Pretty long time to return result. I am having about 500,000 records in my database. select count(distinct(CR_Cli)),SO_name from Callrecords inner join dbo.StudioOperators On CR_StudioOperatorID=SO_ID where datename(month,cr_callstart)='April' and Cr_cli not in (select Cr_cli from Callrecords where cr_callstart<'2009-03-31') group by SO_name desc Is there any way i can write this script? Thanks you very much.
In SQL Server Management Studio, place this query in the workspace and click on the icon that has a description of "display estimated execution plan". This will give you an idea of where there may be table scans and where you might be able to add an index to improve your performance. You should also check to see if your statistics are updated on the tables and indexes involved in this query before running the "display estimated execution plan" as described above. David
-
In SQL Server Management Studio, place this query in the workspace and click on the icon that has a description of "display estimated execution plan". This will give you an idea of where there may be table scans and where you might be able to add an index to improve your performance. You should also check to see if your statistics are updated on the tables and indexes involved in this query before running the "display estimated execution plan" as described above. David