Skip to main content

Questions tagged []

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
11 votes
2 answers

Will these two queries result in a deadlock if executed in sequence?

This is almost certainly the cause of my other question, but I thought it was worth separating the two as I have a hypothesis based on the following log that I would love to have falsified or verified....
RedBlueThing's user avatar
16 votes
2 answers

Trouble deciphering a deadlock in an innodb status log

We are accessing MySQL from the Microsoft ADO.NET connector. Occasionally we are seeing the following deadlock in our innodb status and haven't been able to identify the cause of the problem. It ...
RedBlueThing's user avatar
17 votes
1 answer

Are we required to handle Transaction in C# Code as well as in stored procedure

Do we really require transaction handling in c# as well database store process both side C#: Using(transaction with transaction scope) { Execute stored proc; Transaction. Complete; } SQL ...
Rakesh Gaur's user avatar
38 votes
6 answers

Make SqlClient default to ARITHABORT ON

First things first: I'm using MS SQL Server 2008 with a database at compatibility level 80, and connecting to it with .Net's System.Data.SqlClient.SqlConnection. For performance reasons I've created ...
Peter Taylor's user avatar
7 votes
1 answer

Are there other ways to select a dynamic list of columns?

I need to let my users specify the list of columns they want to select. So far I know two ways of accomplishing that. 1. Using refcursors CREATE OR REPLACE FUNCTION selecttestwithcolumnlist( ticker ...
A-K's user avatar
  • 7,294
23 votes
3 answers

Why is `SELECT @@IDENTITY` returning a decimal?

I'm using Dapper to execute the following query against a SQL Server 2008 R2 Express instance from a ASP.NET MVC 3 (.NET 4.0) application. INSERT INTO Customers ( Type, Name, Address, ...
Greg B's user avatar
  • 559
8 votes
1 answer

.NET executes a SQL query and Active Monitor shows multiple rows blocking each other

I use .NET to execute SQL operations on SQL Server 2014, here's the code used: using(SqlConnection conn = new SqlConnection(connectionString)){ //
Hikari's user avatar
  • 1,553
4 votes
3 answers

AddWithValue performance and plan cache implications

Recently I noticed my company's application using AddWithValueto pass parameter values to dynamic, parameterized queries. Example: cmd.Parameters.AddWithValue("@VehicleId", Vehicles.VehicleId); In ...
Peter's user avatar
  • 1,490
1 vote
2 answers

Getting the metadata about a Query and a Stored procedure in SQL Server

I would like to get all the names of the columns in a given query [SQL Textual Query] and also the columns that are in the SELECT clause in a Stored Procedure. Is there any ways other than using ...
Saravanan's user avatar
  • 443
0 votes
1 answer

Use serial ID for multiple columns and return it from INSERT

I am using Npgsql and I want to be able to do an insert, and if statement that will do an update and then return a value so when ExecuteScalar is called it reads that value. This was done fine in ...
Jon's user avatar
  • 295