Linked Questions

8 votes
2 answers
362 views

Most efficient way to generate a diff

I have a table in SQL server that looks like this: Id |Version |Name |date |fieldA |fieldB ..|fieldZ 1 |1 |Foo |20120101|23 | ..|25334123 2 |2 |Foo ...
ame's user avatar
  • 83
5 votes
1 answer
2k views

varchar and nvarchar in tuning a stored procedure - how to improve performance in this scenario?

I have the following procedure that is called over a million times a day, and I think it can be tuned for better resources usage. ALTER PROCEDURE [DenormV2].[udpProductTaxRateGet] ( @itemNo ...
Marcello Miorelli's user avatar
0 votes
1 answer
2k views

Optimizing performance of INSERT INTO table from INNER JOIN between two large tables

I have the following query: DECLARE @accountCard TABLE ( numUsu VARCHAR(10) ,quantity INT ) /*Takes less than a minute*/ INSERT INTO @accountCard SELECT a.numUsu ,count(*) FROM ...
Heathcliff's user avatar
2 votes
1 answer
337 views

Understanding execution plans using TVPs

I have some slow running queries (8 seconds across 1M records grouped by months) and have been trying to make sense of the execution plans. We use around 10 TVPs to send in a set of filters that the ...
SteveB's user avatar
  • 131
0 votes
1 answer
5k views

TempLog.ldf Grows Too Large [duplicate]

We have a stored procedure that we run regularly. It blows up the size of TempLog.ldf from nothing to 150 GB in the course of 3-4 hours. What's going on and why is it so big? TempDB.mdf is a constant ...
Robbie's user avatar
  • 61
3 votes
1 answer
3k views

Cannot access a temporary table?

I am using ADO/Visual C++ to access SQL Server database. I find it is OK to create only one temp table in the database. But if I create two temp tables and open recordset of one table, and access the ...
user2347976's user avatar
6 votes
1 answer
263 views

MSSQL table variable identification

Is there any way to identify which stored proc is creating a table variable in tempDB? I am looking at the forward_fetch_count in sys.dm_db_index_operational_stats and we have a few tables that have a ...
Evan King's user avatar
1 vote
1 answer
2k views

Another Dynamically alias column question

I might be asking the same question as this, but perhaps if I ask it my way, a different solution may become obvious. I have this: DECLARE @Table1 AS TABLE( Table1ID Int Primary Key ,ColumnName ...
Phillip Senn's user avatar
1 vote
1 answer
3k views

Different execution plans during INSERT at @table variable and #temporary table

I faced with strange situation: inserting of ~800 000 rows into table variable is much more faster than inserting (with the same select) into temporary table. INSERT is under stored procedure. SELECT ...
whitebeast's user avatar
3 votes
1 answer
2k views

Should I use tempdb or memory optimized table variable?

I would like to change some of my stored procs to use memory optimized tables. Before I do this, could you help me to clarify some things? parallel execution Here I can read, the tempdb doesn’t ...
deemon's user avatar
  • 33
3 votes
1 answer
2k views

PAGELATCH_EX on 2:1:128

We are having problems on SQL Server 2012 with contention on tempdb page 2:1:128, which seems to be related with system table sysobjvalues. We have about 400 sessions waiting on this resourse 2:1:...
Renato Ferreira's user avatar
1 vote
1 answer
1k views

Cursors and concurrent users

I typically avoid cursor operations like the plaque, however, I have come across my first problem where using a cursor outperforms a query. So I am forced to use it. I have created an elaborate ...
Ross Bush's user avatar
  • 505

15 30 50 per page
1
2