CPU utilization by database?

Sort of. Check this query out: SELECT total_worker_time/execution_count AS AvgCPU , total_worker_time AS TotalCPU , total_elapsed_time/execution_count AS AvgDuration , total_elapsed_time AS TotalDuration , (total_logical_reads+total_physical_reads)/execution_count AS AvgReads , (total_logical_reads+total_physical_reads) AS TotalReads , execution_count , SUBSTRING(st.TEXT, (qs.statement_start_offset/2)+1 , ((CASE qs.statement_end_offset WHEN -1 THEN datalength(st.TEXT) ELSE qs.statement_end_offset END – qs.statement_start_offset)/2) + 1) AS txt , query_plan FROM sys.dm_exec_query_stats … Read more

How can I force a subquery to perform as well as a #temp table?

There are a few possible explanations as to why you see this behavior. Some common ones are The subquery or CTE may be being repeatedly re-evaluated. Materialising partial results into a #temp table may force a more optimum join order for that part of the plan by removing some possible options from the equation. Materialising … Read more

SQL Server stored procedure Nullable parameter

It looks like you’re passing in Null for every argument except for PropertyValueID and DropDownOptionID, right? I don’t think any of your IF statements will fire if only these two values are not-null. In short, I think you have a logic error. Other than that, I would suggest two things… First, instead of testing for … Read more

Easy way for Crystal Reports to MS SQL Server Reporting Services conversion [closed]

I have searched previously for this, with no luck. There does not seem to be any tools available for this conversion, the manual method thereby becomes the only method. And yes, there are consulting firms who will do the manual work for you, but they still do it manually. Crystal Reports and Reporting Services have … Read more

Code First Migrations and Stored Procedures

I’ve done this like so… In the current migration class – public partial class MyMigration : DbMigration { public override void Up() { … other table creation logic // This command executes the SQL you have written // to create the stored procedures Sql(InstallScript); // or, to alter stored procedures Sql(AlterScript); } public override void … Read more