dbTalk Databases Forums  

code withing transacion wont run...

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss code withing transacion wont run... in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Toni Alfirevic
 
Posts: n/a

Default code withing transacion wont run... - 12-16-2010 , 08:55 AM






Hi,

has anyone ever encountered a problem with MSSQL that would manifest like
this.

If you run specific code outside of transaction. it runs just fine. But if
you put that code within a transaction - transaction fails and does a
rollback.

Issue has occured on different SQL versions (2000, 2008 x86 and 64bit too)
on different OSes (2003, 2008R2).

What I have concluded so far is... That ammount of data that is being
handled with specific code is not big, on contrary it's rather small, tens
of kilobytes and that isolation levels have absolutely no affect to the
outcome. It just fails every time.

Also, code is being run on one server, no network activity is being
triggered by that specific part of code.

Anyone, any clues? Suggestions? Ideas? Anything?

Thank you,
T.

Reply With Quote
  #2  
Old   
Hugo Kornelis
 
Posts: n/a

Default Re: code withing transacion wont run... - 12-16-2010 , 09:10 AM






On Thu, 16 Dec 2010 15:55:20 +0100, Toni Alfirevic
<toni.alfirevic (AT) gmail (DOT) com> wrote:

(snip)
Quote:
Anyone, any clues? Suggestions? Ideas? Anything?
Without seeing the code, or the error messagesd (if any) returned when
running the code?

No.
--
Hugo Kornelis, SQL Server MVP
My SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis

Reply With Quote
  #3  
Old   
Toni Alfirevic
 
Posts: n/a

Default Re: code withing transacion wont run... - 12-16-2010 , 09:21 AM



On Thu, 16 Dec 2010 16:19:33 +0100, Toni Alfirevic wrote:

Quote:
On Thu, 16 Dec 2010 16:10:12 +0100, Hugo Kornelis wrote:

On Thu, 16 Dec 2010 15:55:20 +0100, Toni Alfirevic
toni.alfirevic (AT) gmail (DOT) com> wrote:

(snip)
Anyone, any clues? Suggestions? Ideas? Anything?

Without seeing the code, or the error messagesd (if any) returned when
running the code?

No.

I'm not actually gonna put in the whole procedure. Just the code that is
problematic.

*snip*

and the error returned is...

Msg 0, Level 11, State 0, Line 0
A severe error occurred on the current command. The results, if any,
should be discarded.

Reply With Quote
  #4  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: code withing transacion wont run... - 12-16-2010 , 05:07 PM



Toni Alfirevic (toni.alfirevic (AT) gmail (DOT) com) writes:
Quote:
Msg 0, Level 11, State 0, Line 0
A severe error occurred on the current command. The results, if any,
should be discarded.
So this is a bug. If you look in the SQL Server error log, you will
probably find a stack dump. That is, SQL Server ran into some internal
error like an access violation, and had to kill your process.

It is also possible that the error happens on the client-side - in fact
the severity of 11 indicates this possibility.

Try running the same command from SQLCMD and OSQL, this may or may
not give more information.

What does SELECT @@version return?


--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx

Reply With Quote
  #5  
Old   
Toni Alfirevic
 
Posts: n/a

Default Re: code withing transacion wont run... - 12-17-2010 , 04:40 AM



On Fri, 17 Dec 2010 00:07:36 +0100, Erland Sommarskog wrote:

Quote:
Toni Alfirevic (toni.alfirevic (AT) gmail (DOT) com) writes:
Msg 0, Level 11, State 0, Line 0
A severe error occurred on the current command. The results, if any,
should be discarded.

So this is a bug. If you look in the SQL Server error log, you will
probably find a stack dump. That is, SQL Server ran into some internal
error like an access violation, and had to kill your process.

It is also possible that the error happens on the client-side - in fact
the severity of 11 indicates this possibility.
Client as a application on IIS or client as a Microsoft SQL Server
Management Studio?

Anyway the story goes like this. It has been brought to my attention that
something is not working as intended so I've tried runing that specific
stored procedure manually from management studio, same stored p. that ASP
aplication runs. And the problem is as I've described.

Quote:
Try running the same command from SQLCMD and OSQL, this may or may
not give more information.

What does SELECT @@version return?
@@version is on this specific system is:

Microsoft SQL Server 2008 (SP1) - 10.0.2766.0 (X64) Feb 25 2010 12:51:37
Copyright (c) 1988-2008 Microsoft Corporation Standard Edition (64-bit) on
Windows NT 6.1 <X64> (Build 7600: )

Same issue occurs on:
Microsoft SQL Server 2008 R2 (RTM) - 10.50.1600.1 (X64) Apr 2 2010
15:48:46 Copyright (c) Microsoft Corporation Standard Edition (64-bit)
on Windows NT 6.1 <X64> (Build 7600: ) (Hypervisor)

And on one version of SQL 2000 currently the VPN server is down so i cant
run @@version.

Odd stuff.

Reply With Quote
  #6  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: code withing transacion wont run... - 12-17-2010 , 04:30 PM



Toni Alfirevic (toni.alfirevic (AT) gmail (DOT) com) writes:
Quote:
Client as a application on IIS or client as a Microsoft SQL Server
Management Studio?
More specifically it could be an error in the client API. Which is in this
case is SqlClient in ADO .Net.

Quote:
Anyway the story goes like this. It has been brought to my attention that
something is not working as intended so I've tried runing that specific
stored procedure manually from management studio, same stored p. that ASP
aplication runs. And the problem is as I've described.
Do you see different results in SSMS and the ASP application?

Quote:
@@version is on this specific system is:

Microsoft SQL Server 2008 (SP1) - 10.0.2766.0 (X64) Feb 25 2010 12:51:37
Copyright (c) 1988-2008 Microsoft Corporation Standard Edition (64-bit)
on Windows NT 6.1 <X64> (Build 7600: )
There is a Service Pack 2 out for SQL 2008. But whether it address the
issue you're seeing I don't know.




--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.