Skip to main content
Filter by
Sorted by
Tagged with
-1 votes
1 answer
114 views

Although my database isolation level is set to READ_COMMITTED_SNAPSHOT, I am still getting dirty (uncommited) reads. SELECT COUNT([random_string]) NoTx FROM [dbo].[IncTesting5]; BEGIN TRANSACTION; ...
FranLegon's user avatar
0 votes
0 answers
48 views

I'm just trying to understand a bit more about the behaviour of HOLDLOCK in the scenario where multiple transactions are running concurrently. The transaction is basically doing the following: Start ...
Spud's user avatar
  • 35
0 votes
0 answers
141 views

I'm using MediatR to create an order with two types of tasks. Each task has its own command, and I would like to use a transaction to ensure that both types of tasks are saved, or none are saved. I ...
Adoulou's user avatar
  • 55
-1 votes
1 answer
454 views

With a data frame of IPs and updated status, we first need to delete the data frame's IPs from the SQL table. After that, we should insert this data frame with the updated status using Spark SQL. ...
Rishika Arora's user avatar
1 vote
0 answers
196 views

I'm trying to troubleshoot what is causing timeouts when querying specific table in production. I suspected that there are some uncommitted transactions, so I ran following query: SELECT trans....
Liero's user avatar
  • 27.8k
0 votes
0 answers
54 views

I have some code that goes like this: SqlTransaction trans = conn.BeginTransaction("MyTransfer"); cmdStep1.ExecuteScalar(); cmdStep2.ExecuteScalar(); cmdStep3.ExecuteScalar(); ...
Christina Arvig's user avatar
1 vote
1 answer
246 views

Please find the below sample code drop table if exists #myTest create table #myTest ( id int, name varchar(30) ) insert into #myTest values (1, 'John')...
KnowledgeSeeeker's user avatar
0 votes
1 answer
1k views

I get error message "Transaction (Process ID 60) was deadlocked on lock resources with another process ...". I have two simple queries like: Query 1: BEGIN try SET TRANSACTION ISOLATION ...
Mohammad Galouz Lee's user avatar
0 votes
0 answers
552 views

We want to use a stream to insert data from a source table to multiple target tables. For that purpose, we have created steam on the source table. We are using a Java script procedure for this. We are ...
YogeshR's user avatar
  • 1,776
0 votes
1 answer
670 views

I have some code that needs to be run in a Tx like here I generated a go sql migration as mentioned here in the official docs for go goose my questions are: when are these transactions actually ...
AthulMuralidhar's user avatar
1 vote
1 answer
71 views

I what to create an event that delete rows fom a table that are older than 15 minus and add their value back to other table. In the code below mysql said that I have a syntax error on line 5 CREATE ...
anzedolenc's user avatar
0 votes
1 answer
397 views

I can see in the PHP documentation that begin_transaction can fail. How can I make it fail? (All of my tables use the InnoDB engine. MySQL version 5.7.38-log.) Why do I care? I'm investigating a ...
user21266319's user avatar
1 vote
1 answer
1k views

I am not familiar with Room Database. I want to clear the data from some tables when I click on button. I have the similar code in IOS but I am not sure where I have to write this method and call ...
kartheeki j's user avatar
  • 2,326
1 vote
2 answers
2k views

We have a use case where we need to execute multiple update statements(each updating different set of rows) on the same table in snowflake without any latency caused by queuing time of the update ...
Krishna Kanna's user avatar
4 votes
0 answers
404 views

In the .NET core web API application we are using MS SQL transactions in one service method and in the middle of that method, we are calling another service method, inside this method when trying to ...
SENTHIL VEL's user avatar
1 vote
1 answer
65 views

According to https://dev.mysql.com/doc/refman/8.0/en/innodb-multiple-buffer-pools.html, buffer pool was protected by its own buffer pool mutex. So there is only one data request can visit buffer pool ...
rayen's user avatar
  • 89
0 votes
1 answer
1k views

I am taking a Database Design & Development course, and I just learned about SQL transactions. The textbook (Learning SQL 3rd Edition by Alan Beaulieu) is really good at explaining how things work,...
Jacob Hornbeck's user avatar
3 votes
2 answers
8k views

Can anyone help to implement MS SQL transactions in Node.js . I am try to execute multiple stored procedures inside a promise. Method 1 const executeProcedure = async (data1, data2) => { try { ...
Kmss's user avatar
  • 43
1 vote
1 answer
719 views

I have a simple drop and add a constraint encapsulated in a transaction as follows: begin; alter table movies drop constraint actor_check; alter table movies add constraint actor_check check ( "...
Saqib Ali's user avatar
  • 4,551
0 votes
2 answers
1k views

I have following with two using block: using (SqlConnection connection = new SqlConnection(_connectionString)) { String query = "query..."; using (SqlCommand command = new SqlCommand(...
ElConrado's user avatar
  • 1,640
-2 votes
1 answer
46 views

Can you please tell me why c and d are the right answers here ? Thank you Select the statements that can be used to complete the following SQL code block BEGIN TRANSACTION SELECT COUNT(*) FROM ...
Madison John's user avatar
1 vote
1 answer
168 views

I've been searching everywhere, to try and get over this issue but I just can't figure this out. I'm trying to make many changes to the DB with one single transaction using LINQ to SQL. I've created a ...
Tiago Almeida's user avatar
0 votes
2 answers
835 views

I have an insert query with subqueries which i want to run on a Postgres database. But i'm not sure if the query with its subqueries run in a single transaction. We have two entities 'configs' and '...
thebigone12's user avatar
0 votes
1 answer
58 views

I have this static method that executes a SQL statement: static save(habit){ return db.execute( 'INSERT INTO habits (name, repeatVal, notification, color, question, id) VALUES (?, ?, ?, ?, ...
be2021's user avatar
  • 49
1 vote
1 answer
1k views

I want to understand how transactions work in SQL, specifically in PostgreSQL Imagine I have a very large table (first_table) and the query below lasts 2 seconds and I execute the query below via psql....
Eduardo G's user avatar
  • 450
0 votes
0 answers
502 views

Let's say I have some C# code that executes two SQL commands: var MyTransaction = DbConnection.BeginTransaction(); //using MyTransaction: INSERT INTO TABLE_1 (ID, SOURCE_FIELD) VALUES (99, 'HELLO') //...
user3163495's user avatar
  • 4,046
1 vote
1 answer
239 views

I have a transaction. The code is set implicit_transactions on select getdate() begin transaction begin transaction select * from price p1, product p2 where p1.product_id = p2.product_id rollback ...
George L's user avatar
0 votes
2 answers
35 views

I have table T1 ID Size A 1 A 2 A 3 B 3 B 4 C 2 C 4 I want to group by ID and filter the smallest size for each ID Desired outcome: A 1 B 3 C 2 I tried doing something like this: SELECT ID, ...
J D's user avatar
  • 3
0 votes
0 answers
427 views

I have large DB model (hundred of tables) split to multiple EntityFrameworkCore DbContexts. Is is a quite common use case when I modify multiple entities in two (or more) different DbContexts, but I ...
Luke1988's user avatar
  • 2,158
0 votes
0 answers
192 views

So I have two tables, Records (Input ID = Primary Key) and TaskNotes (Input Id, TaskNote : No primary key). There used to be a single stored procedure which would add to the record table, get the ...
Tiernan's user avatar
  • 33
-1 votes
1 answer
110 views

I've faced this strange thing that I can't set the value of a variable to a result of a query. The query is reading the collation of a database and works fine by itself: SELECT collation_name FROM ...
Iraj's user avatar
  • 389
1 vote
2 answers
3k views

I have a transaction and two tables where i am inserting some data, can I do partial commits in SQL server BEGIN TRANSACTION tran1 BEGIN TRY --Insert into Table1 --Insert into Table2 COMMIT ...
VR1256's user avatar
  • 1,460
1 vote
2 answers
868 views

What I'm trying to achieve is: I'm calling stored procedures from 2 different databases. SP's have a simple insert entry in a table. There is no problem if both the transactions are successful, But ...
Code Wines's user avatar
6 votes
2 answers
2k views

I am seeing constant deadlocks in my app, even though it performs no select statements, no delete statements, and no update statements. It is only inserting completely new data. TL;DR: It seems to be ...
Peter Morris's user avatar
  • 23.6k
0 votes
1 answer
1k views

Say I have 2 methods (A and B) public void A() { using (var connection = Database.GetConnectionString()) using (var tran = new TransactionScope()) { //do "A" tran....
tickwave's user avatar
  • 3,485
0 votes
1 answer
221 views

As the title says, what are the full requirements to get a SQL transaction running with SQL Server? The transaction will eventually get more complex, but so far the debugging process has left me with ...
Joe's user avatar
  • 760
-1 votes
1 answer
150 views

I am inserting values from PowerShell into MySQL table. I have 2 Insert statements (insertQuery1,insertQuery2) in transaction. There is COMMIT after insertQuery1 so changes in query_1 is committed but ...
sql_dummy's user avatar
  • 783
0 votes
1 answer
393 views

I have created an API to add multiple items. I use transaction scope because I don't have to insert all items if found a problem in any item. so I have used TransactionScope so doing dispose of the ...
Abhijit Pandya's user avatar
-1 votes
1 answer
171 views

I am looking to mix table locks and transactions in an API. I have selected MySQL 5.7 as the storage engine, though I am not particularly committed to any specific RDBMS. I am interested in seeing ...
halfer's user avatar
  • 20.2k
0 votes
0 answers
317 views

I have a scenario where i need to perform INSERT Operation on multiple SQL tables, There is a dependency for inserting records in each table. I want to perform first INSERT to Deal table and then ...
Rahul Hendawe's user avatar
8 votes
5 answers
21k views

I am brand new to SQL, and I am learning on an SQLite editor. So I create a couple of very simple tables. This code is straight from Linkedin learning "SQL essential training", and I am using the ...
Jabernet's user avatar
  • 431
-1 votes
2 answers
744 views

My database contains two tables FileStore and FileRepository. The FileStore table contains 3 columns Id (autogenerated uniqueidentifier), FileName and Description -> In Initial state with demo data ...
Suraj Nair's user avatar
1 vote
0 answers
33 views

As far as I read, this statement is atomic. Either both will fail or both will succeed: DELETE FROM TABLE1 OUTPUT DELETED.* INTO TABLE2 WHERE <condition> I have these statements executed ...
Amit's user avatar
  • 11
1 vote
1 answer
1k views

Looking for some insights on using Transaction or Delete queries when the subsequent request fails. In brief, in my application, I'm inserting into two tables by calling two stored procedures and the ...
S.Siva's user avatar
  • 2,131
2 votes
3 answers
12k views

I have a table named a that has 26 rows: Select * from a Output is 26 Begin Tran Truncate table a Select * from a Output is zero rows Rollback Tran Select * from a Output is again 26 rows Truncate ...
Ankush's user avatar
  • 347
0 votes
1 answer
55 views

In the image the target is top calculate years since last DX. A year level we want to calculate thw number of years since we have found a DX. Eg There was a dx for id 1 in 2014 so in 2015,2016 and ...
Nirvana's user avatar
3 votes
1 answer
231 views

I have an SQL CLR Stored Procedure which registers an event handler for the completion of the current transaction [SqlProcedure] public static void MySProc() { Transaction.Current....
Franco Tiveron's user avatar
6 votes
1 answer
2k views

I'm not sure how to achieve consistent read across multiple SELECT queries. I need to run several SELECT queries and to make sure that between them, no UPDATE, DELETE or CREATE has altered the ...
Yves M.'s user avatar
  • 31.3k
0 votes
0 answers
382 views

Full error: .Net SqlClient Data ProviderThe INSERT statement conflicted with the FOREIGN KEY constraint "FK_SalesOrder_SalesOrderHead". The conflict occurred in database "ControlSecurity", table "dbo....
awaisharoon's user avatar
0 votes
0 answers
227 views

DELIMITER // CREATE PROCEDURE 'execute_transaction'(IN sql_text VARCHAR(8000)) BEGIN DECLARE EXIT HANDLER FOR SQLEXCEPTION BEGIN Rollback; SELECT CONCAT(sql_text, 'is not ...
Miladfa7's user avatar
  • 432

1
2 3 4 5