Tag Info

New answers tagged

-1

Directly use proc parametes in your queries (@date) If you have un-even data distribution in your table, Parameter sniffing could hurt performance when the plan that was already in cache is used for your current execution, which is has different parameter value and the data distribution is drastically different for this parameter value. Say, 5 rows vs 1000 ...


3

Seriously, stop using Entity Framework. It's great for scaffolding a quick proof-of-concept, but in terms of Production systems, it's rubbish. You also have a SELECT TOP 50 without an order by. What order would you like the results to come back? What is TOP? The way it stands, you could get results in any order In any case, start by rewriting your query ...


0

I know my answer might be late. Yes, this used to happen when SQL server is restarted. See here for more information (as given in other answers). With SQL Server 2014, it has been fixed (identity wont increased by 1000) only if there was a planned SQL Server restart. I have solved in another way by adding a start up stored procedure in SQL Server 2012. ...



Top 50 recent answers are included