Tag: performance

EntityFramework VS SQL Stored PROCEDURE

I have a table with more than 10,000,000 Rows. I need some filters (some in queries and some like queries) and dynamic order by I wondered what is the best way to work with big data, Pagination, Filtering and ordering. Of course its easy to work with entity framework, But I think the performance better […]

SQL Join on table with multiple identical values

I have inherited a database where some tables contain multiple identical values. table A aId (PK), RowId, Value, CreateDate table Row RowId (PK) Table A (20M entries) contains a lot of multiple identical entries of RowId and Value (CreateDate would differ though), typical 20 identical entries for each RowId. I want to do this query: […]

SQL Server Extreme slowness after reboot or fail-over of cluster

I have a SQL Server 2008 R2 SP1 cluster with 2008 OS. Any time a reboot happens or a failover happens the next several days any processing is extremely slow; however if we leave them running they run much better. I have been researching the possibility when the procedure cache is flushed then with all […]

Checksum counterpart in .net

I want to acquire a hashbytes/checksum function in C# that does exactly like SQL Server. Our SPA is posting a lot of data to our backend and I want to check for duplicates in the database before inserting. Though the best way to do this is to calculate a hash/checksum for the values I want […]

How to compare records in one table quickly?

I have a project for literature researches with a table(in SQL Server 2014). I extract words from some books to comparison table. this table may have thousands of words. I write a query to compare words in different documents and want to show them side by side to show that each word frequency in different […]

How to use temporary table in stored procedure

I have created temporary table and would like to use it in place of CASE statement in my stored procedure. Let me know how can I do it in order to write readable code and performance improvement. CREATE TABLE #Table_FreeMealsIndicator(STFM_LearnFAMCode char(3) NULL) INSERT INTO #Table_FreeMealsIndicator SELECT CASE WHEN STFM_LearnFAMCode=1 THEN ’14-15 year old learner is […]

SQL Server query is slow but when testing on tempdb, it works fast

I have a slow query which contains more than 10 left join and 10 like operators. see bellow. SystemContact has approx. 10K of data, the other two have more than 100k of data. The query looks not optimized, this is because it is generated by a program used to search SystemContact. The problem that I […]

SQL Server improve query performance #Temp Table, Bulk insert

I am working on an old auditing stored procedure that is taking a long time to get data causing timeouts on the system. We have managed to get the time down from over 20 minutes to running just over a minute, this is still too long. I am running on SQL Server 2008 R2. My […]

Using “Select INTO” for million of records

I’m using the SELECT INTO statement to create my SQL statement result. SELECT fields INTO [newtable] FROM table1, table2, table3, table4 [where clause to filter records from four tables] I would like to know how this statement would impact the performance if there million of records to insert into new table. Will there be OutOfMemory […]

SSIS 2012, reading (small) nvarchar(max), sluggish performance

I’m reading some data from a SQL Server 2012. The source table has some 600 million rows, and two of the headache columns are nvarchar(max). Problem: The performance drops from 100k rows per second to 800 per second when including these blob columns. Is there some way in make things go faster with blobs in […]

MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.