Stack Exchange network consists of 183 Q&A communities includingStack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
I have a high-traffic SQL Server stored procedure that runs thousands of times per hour. The procedure loads a filtered set of “projects” for a user, identifies the “active task” for each project, ...
Example code below populates a PhoneNumber table and associates those PhoneNumberId's with an OrderNumber.As written I am getting the error message:The current transaction cannot be committed and ...
We are converting a database from SQL Server 2022 to Postgres 18.Our system has a lot of code in the database and a lot of queries that use local temp tables a lot more than CTE's. This is due to the ...
We a running an instance of Apache syncope with around 130k users (ca. 33k with active or pending state). When searching for users by attributes we see long query times often over 50 seconds. One ...
I'm getting occasional deadlocks on temp tables in two different connections (at least as far as I can tell, the deadlock graph shows different spids). The deadlock graph (lightly redacted, and with ...
I am not an expert in PostgreSQL, however I recently ran across some PostgreSQL code during a code review which creates and drops temporary tables in a manner that seems consistent with the typical ...
I manage a web service. The service has multiple endpoints, and most of these endpoints simply return some data representing an entity (such as a track, genre or composer). Each endpoint usually ...
I'm using temp tables to stage data before inserting into production. As a couple of things use them, before anything else I do a:IF OBJECT_ID(N'##Projects_TEMP') IS NOT NULLTRUNCATE TABLE ##...
I have observed (and reproduced) the following scenario with SQL Server 2022.The pattern in usecode is executed via sp_executesql (no stored procedure is involved)The first query selects data into ...
We are facing default temporary tablespace disk space full issue due to lots of below temporary relations files created but not removed after ending session1.1G t756_1536213694.4091.1G ...
Frequent recompilation happens in one SP with 'Temp table changed' cause. What kinds of operations on temp table would trigger this? There are no alter and create index operations on temp table, just ...
I'm at a loss as to why some SQL leveraging sp_executesql is working the way it is when temporary tables are involved, along with INSERT and SELECT - INTO. I'm using SQL Server.Here is the code in ...
LinksThis takes up:Using temporary tables in SSIS flow fails - Stack OverflowIs it possible to use a temp table in a data flow source?; answer is:'No', since it cannot be passed without being ...
I came to ask this question after coding in a script component for some time, testing mainly how to loop over columns of the Row object, see Looping Through Columns in SSIS Script Component - Stack ...
My confusion is down to an apparent contradiction in principles. Primary keys are indexes and those always have statistics, but table variables notoriously always don't have statistics. What follows ...