Showing posts with label trace. Show all posts
Showing posts with label trace. Show all posts

Friday, March 9, 2012

Decipher waitresource

I am trying to analyze a dead lock trace.

I see this in the waitresource

waitresource=KEY: 9:72057594065256448 (ef008dce9cbe)

How can I find the exact key thats causing the problem? Thanks!

Look at the Trace Flag 1222 Example in SQL Server 2005 Books Online topic:
Detecting and Ending Deadlocks
http://msdn2.microsoft.com/en-us/library/ms178104.aspx

For example:

waitresource=KEY: 6:72057594057457664
dbid=6 objectname=AdventureWorks.dbo.T2
associatedObjectId=72057594057457664
keylock hobtid=72057594057457664

Decimal.MinValue throw OverflowException

I'm using Decimal.MinValue in SqlParameter( SqlDbType.Decimal ) to execute a stored procedure.

But, I receive this stack trace exception:

System.OverflowException: Conversion overflows.
at System.Data.SqlTypes.SqlDecimal.ToDecimal()
at System.Data.SqlTypes.SqlDecimal.get_Value()
at System.Data.SqlClient.TdsParser.AdjustDecimalScale(Decimal value, Int32 newScale)
at System.Data.SqlClient.TdsParser.TdsExecuteRPC(_SqlRPC[] rpcArray, Int32 timeout, Boolean inSchema, SqlNotificationRequest notificationRequest, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()

I have changed Decimal.MinValue to Decimal.Zero to resolve my trouble. But, Why Decimal.MinValue throw OverflowException? Isn't Decimal.MinValue valid SqlDbType.Decimal type?

From the online help:

The value of this constant is negative 79,228,162,514,264,337,593,543,950,335.

How many digits did you set the decimal database field to accept?

|||

Hi,

Please check if the decimal scale and precision are set correctly in both .NET and database.

The should be match, so the data conversion can work properly.

HTH. If this does not answer your question, please feel free to mark the post as Not Answered and reply. Thank you!

Sunday, February 19, 2012

Debugging Exception Errors in SQL Server Profiler

I have been having weird problems from my SQL Server, and decided to run a
trace. Well, I found my problem really fast, except I really don't know
what the problem is!
First off I am developing ASP apps for working with the DB, and this is
where the problem has arisen. It used to error me on my client machine, now
it just kind of locks up and acts like it is still running.
When I run trace on a page that I am developing, it gives me the following
error,
EventClass TextData
Exception Error: 207, Severity: 16, State: 3
A few lines above this entry is one that says Attention, but there is no
TextData or anything.
How do I find out where these problems are coming from?
Thanks,
DrewFrom SQL BOL:
Error 207
Severity Level 16
Message Text
Invalid column name '%.*ls'.
Explanation
This error occurs when a column referenced in a Transact-SQL statement was
not found in any table specified in the FROM clause of the query
--
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Drew" <drew.laing@.NOswvtc.dmhmrsas.virginia.SPMgov> wrote in message
news:OZs5UH$yEHA.4044@.TK2MSFTNGP10.phx.gbl...
> I have been having weird problems from my SQL Server, and decided to run a
> trace. Well, I found my problem really fast, except I really don't know
> what the problem is!
> First off I am developing ASP apps for working with the DB, and this is
> where the problem has arisen. It used to error me on my client machine,
now
> it just kind of locks up and acts like it is still running.
> When I run trace on a page that I am developing, it gives me the following
> error,
> EventClass TextData
> Exception Error: 207, Severity: 16, State: 3
> A few lines above this entry is one that says Attention, but there is no
> TextData or anything.
> How do I find out where these problems are coming from?
> Thanks,
> Drew
>|||Ok, I guess the question from here is, why doesn't it error out on the page?
Or at least show a generic error page. This error doesn't seem fatal, but
it won't show me a 404 page or anything... the progress bar at the bottom of
IE just keeps going up...
Have I disabled errors or somethign?
Thanks,
Drew
"Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message
news:e0irCM$yEHA.824@.TK2MSFTNGP11.phx.gbl...
> From SQL BOL:
> Error 207
> Severity Level 16
> Message Text
> Invalid column name '%.*ls'.
> Explanation
> This error occurs when a column referenced in a Transact-SQL statement was
> not found in any table specified in the FROM clause of the query
> --
> --
> Mike Epprecht, Microsoft SQL Server MVP
> Zurich, Switzerland
> IM: mike@.epprecht.net
> MVP Program: http://www.microsoft.com/mvp
> Blog: http://www.msmvps.com/epprecht/
> "Drew" <drew.laing@.NOswvtc.dmhmrsas.virginia.SPMgov> wrote in message
> news:OZs5UH$yEHA.4044@.TK2MSFTNGP10.phx.gbl...
>> I have been having weird problems from my SQL Server, and decided to run
>> a
>> trace. Well, I found my problem really fast, except I really don't know
>> what the problem is!
>> First off I am developing ASP apps for working with the DB, and this is
>> where the problem has arisen. It used to error me on my client machine,
> now
>> it just kind of locks up and acts like it is still running.
>> When I run trace on a page that I am developing, it gives me the
>> following
>> error,
>> EventClass TextData
>> Exception Error: 207, Severity: 16, State: 3
>> A few lines above this entry is one that says Attention, but there is no
>> TextData or anything.
>> How do I find out where these problems are coming from?
>> Thanks,
>> Drew
>>
>|||Also, If I try to run this page, with that error and then go to the server I
get this error,
"Unable to load SQL Server OLEDB Provider resource dll. The application
cannot continue."
Any ideas?
Thanks,
Drew
"Drew" <drew.laing@.NOswvtc.dmhmrsas.virginia.SPMgov> wrote in message
news:OpJtXQ$yEHA.2876@.TK2MSFTNGP12.phx.gbl...
> Ok, I guess the question from here is, why doesn't it error out on the
> page? Or at least show a generic error page. This error doesn't seem
> fatal, but it won't show me a 404 page or anything... the progress bar at
> the bottom of IE just keeps going up...
> Have I disabled errors or somethign?
> Thanks,
> Drew
>
> "Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message
> news:e0irCM$yEHA.824@.TK2MSFTNGP11.phx.gbl...
>> From SQL BOL:
>> Error 207
>> Severity Level 16
>> Message Text
>> Invalid column name '%.*ls'.
>> Explanation
>> This error occurs when a column referenced in a Transact-SQL statement
>> was
>> not found in any table specified in the FROM clause of the query
>> --
>> --
>> Mike Epprecht, Microsoft SQL Server MVP
>> Zurich, Switzerland
>> IM: mike@.epprecht.net
>> MVP Program: http://www.microsoft.com/mvp
>> Blog: http://www.msmvps.com/epprecht/
>> "Drew" <drew.laing@.NOswvtc.dmhmrsas.virginia.SPMgov> wrote in message
>> news:OZs5UH$yEHA.4044@.TK2MSFTNGP10.phx.gbl...
>> I have been having weird problems from my SQL Server, and decided to run
>> a
>> trace. Well, I found my problem really fast, except I really don't know
>> what the problem is!
>> First off I am developing ASP apps for working with the DB, and this is
>> where the problem has arisen. It used to error me on my client machine,
>> now
>> it just kind of locks up and acts like it is still running.
>> When I run trace on a page that I am developing, it gives me the
>> following
>> error,
>> EventClass TextData
>> Exception Error: 207, Severity: 16, State: 3
>> A few lines above this entry is one that says Attention, but there is no
>> TextData or anything.
>> How do I find out where these problems are coming from?
>> Thanks,
>> Drew
>>
>>
>|||See http://support.microsoft.com/kb/821535
From http://www.developmentnow.com/g/118_2004_11_0_0_479224/Debugging-Exception-Errors-in-SQL-Server-Profiler.ht
Posted via DevelopmentNow.com Group
http://www.developmentnow.com