Questions tagged [ado.net]
66 questions
39
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 an indexed view. As a result, updates to tables…
Peter Taylor
- 531
- 1
- 4
- 6
30
votes
3 answers
What is the "Chaos" Isolation level and when should it be used?
ADO.NET documentation shows the possibility of setting the transaction level for a SQL transaction to Chaos. It sounds unpleasant, but if the feature is there, presumably it has some legitimate use.
The SET TRANSACTION ISOLATION LEVEL command in BOL…
MatthewMartin
- 402
- 1
- 4
- 8
24
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, ContactName,
ContactNumber, ContactEmail,…
Greg B
- 569
- 2
- 6
- 15
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 stored procedure:
Create process
As
Begin try
…
Rakesh Gaur
- 185
- 1
- 1
- 6
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 looks like transaction (2) is waiting for and holding…
RedBlueThing
- 600
- 6
- 16
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.
My hypothesis is that the other deadlock is…
RedBlueThing
- 600
- 6
- 16
11
votes
2 answers
How can I get individual rowcounts like SSMS?
I have a client c# program that is executing stored procedures via ExectueNonQuery, including catching the PRINT and Error output with InfoMessage events. It works fine, but I have noticed something odd.
When I execute a stored procedure from SSMS,…
RBarryYoung
- 3,051
- 4
- 25
- 42
10
votes
1 answer
What are the ramifications of setting ARITHABORT ON for all connections in SQL Server?
So I've determined that the erratic behavior of my SQL Server is because of .Net SqlClient Data Provider's default setting of SET ARITHABORT OFF. With that said, I've read various articles that debate the best way to implement this. For me, I just…
Eric Swiggum
- 694
- 1
- 12
- 31
9
votes
1 answer
SQL server temp table using # - is it only accessible by the containing query for multiple connections with the same login?
Say we have 2 completely different queries, that reference a temp table with the same name:
query one
....operates on:
#tempTableName
query two
....operates on:
#tempTableName
I've researched this and found out that "#temp is a local…
Chris Halcrow
- 265
- 1
- 5
- 10
8
votes
1 answer
Perform reads and writes in the same transaction
I'm trying to implement transactions in my application. I'm just trying to implement it like the example shown in the BeginTransaction() documentation.
Public Shared Sub Process(wwid As String, trade_id As Integer, disposition As Boolean)
Dim q…
David Krider
- 77
- 3
- 8
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)){
//https://stackoverflow.com/questions/1880471/capture-stored-procedure-print-output-in-net
…
Hikari
- 1,603
- 12
- 28
- 42
8
votes
2 answers
How to track SSIS memory and CPU performance?
I may be missing some pieces to this puzzle, but this is what I have:
All of this was written for us by an outside firm.
There is a .Net application that runs as a service on Server A.
Inside that application SSIS packages are being called.…
Kevin3NF
- 1,221
- 1
- 11
- 19
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 character varying,
columnlist character varying)
…
A-K
- 7,444
- 3
- 35
- 52
6
votes
1 answer
Is there an upper limit to the SqlDbType.Structured ADO.NET type?
Is there an upper limit to the number of rows\total size of the SqlDbType.Structured type when sending data to a Table parameter in a sproc?
I can't find anything to suggest there is so I'm assuming that there'd just be a time-out if a giant data…
BanksySan
- 1,011
- 1
- 12
- 16
6
votes
3 answers
Is the ADO.NET Entity Framework known for generating poorly performing queries?
This question is inspired by the comment posted to the latest ServerFault blog post:
Are you guys still using LINQ to SQL?
I know I can use SQL Server Profiler and/or the ToTraceString method to see the generated queries and analyze them myself.…
Marek Grzenkowicz
- 1,495
- 2
- 18
- 27