SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Identifying Error
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

sital
Yak Posting Veteran

89 Posts

Posted - 01/29/2009 :  23:14:55  Show Profile  Reply with Quote
How can one identify what is the error in the query?

What are the commonly made mistakes in SQL Server 2005?

Where should one look for the error since the error displayed in the results pane contains the message no.?So do you recognise error based on that message No.?

raky
Aged Yak Warrior

767 Posts

Posted - 01/29/2009 :  23:38:09  Show Profile  Reply with Quote
When u execute the query it displays the errormessage,errorid if there are any errors. Just google with errorid.you will get info about it.
Go to Top of Page

sital
Yak Posting Veteran

89 Posts

Posted - 02/02/2009 :  11:31:55  Show Profile  Reply with Quote
quote:
Originally posted by raky

When u execute the query it displays the errormessage,errorid if there are any errors. Just google with errorid.you will get info about it.



I tried searching it but it is not giving any proper results. So can you please give me any other method or any example of searching it in Google?
Go to Top of Page

Transact Charlie
Flowing Fount of Yak Knowledge

United Kingdom
3451 Posts

Posted - 02/02/2009 :  11:46:19  Show Profile  Visit Transact Charlie's Homepage  Reply with Quote
There are a lot of possible errors!

If your sql calls a stored proc and that returns an error value set by some programmer then we've got no idea what that means.

Why don't you post the sql you are trying and the text of the error message?


Charlie
===============================================================
Msg 3903, Level 16, State 1, Line 1736
The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION
Go to Top of Page

sital
Yak Posting Veteran

89 Posts

Posted - 02/03/2009 :  05:29:17  Show Profile  Reply with Quote
quote:
Originally posted by Transact Charlie

There are a lot of possible errors!

If your sql calls a stored proc and that returns an error value set by some programmer then we've got no idea what that means.

Why don't you post the sql you are trying and the text of the error message?


Charlie
===============================================================
Msg 3903, Level 16, State 1, Line 1736
The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION





Thanks for your support.But I would like to know if there is any idea or trick which you usually apply to solve any error?
Go to Top of Page

Transact Charlie
Flowing Fount of Yak Knowledge

United Kingdom
3451 Posts

Posted - 02/03/2009 :  05:35:44  Show Profile  Visit Transact Charlie's Homepage  Reply with Quote
quote:
Originally posted by sital

quote:
Originally posted by Transact Charlie

There are a lot of possible errors!

If your sql calls a stored proc and that returns an error value set by some programmer then we've got no idea what that means.

Why don't you post the sql you are trying and the text of the error message?


Charlie
===============================================================
Msg 3903, Level 16, State 1, Line 1736
The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION





Thanks for your support.But I would like to know if there is any idea or trick which you usually apply to solve any error?



Well first of all I start looking for more information....................................................................................................................................................................................................................


Charlie
===============================================================
Msg 3903, Level 16, State 1, Line 1736
The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION
Go to Top of Page

raky
Aged Yak Warrior

767 Posts

Posted - 02/03/2009 :  05:36:40  Show Profile  Reply with Quote
There is no trick to solve any error. Just understanding the error message correctly helps us to max extent to solve the error. On practise u will solve the errors quickly if it arises again....Just what u need is practise
Go to Top of Page

sital
Yak Posting Veteran

89 Posts

Posted - 02/03/2009 :  05:38:46  Show Profile  Reply with Quote
quote:
Originally posted by raky

There is no trick to solve any error. Just understanding the error message correctly helps us to max extent to solve the error. On practise u will solve the errors quickly if it arises again....Just what u need is practise



ok thanks.
Go to Top of Page

sital
Yak Posting Veteran

89 Posts

Posted - 02/03/2009 :  05:38:48  Show Profile  Reply with Quote
quote:
Originally posted by raky

There is no trick to solve any error. Just understanding the error message correctly helps us to max extent to solve the error. On practise u will solve the errors quickly if it arises again....Just what u need is practise



ok thanks.
Go to Top of Page

Transact Charlie
Flowing Fount of Yak Knowledge

United Kingdom
3451 Posts

Posted - 02/03/2009 :  05:42:35  Show Profile  Visit Transact Charlie's Homepage  Reply with Quote
Seriously though (and this will be the last post here unless you stop talking about vague non issues).

If it's in Management studio (which I generally work in all the time). Assuming this is an in vitro SQL error (syntax - error condition whatever) I check the messages tab.

Looking for messages like this:

Msg 208, Level 16, State 1, Line 1
Invalid object name 'bar'.


Normally the text of the message helps me understand what went wrong.

If the problem is not an ERROR per se: something happened that I didn't expect to happen but it didn't FAIL some syntax / referential check then things get complicated -- that's when you have to:

1) Know your schema
3) Know how your code works -- what could possibly go wrong. Do you have enough debug logic in there.

If whatever I'm running just hasn't finished when I expected it to then I'll start looking at running jobs on the database. If there is a problem with the Application using the database my company builds then I've got access to the code and can run my own application in an IDE -- I can then breakpoint the code / trap exceptions / the usual.

In answer to the question:
quote:
I would like to know if there is any idea or trick which you usually apply to solve any error?

NO -- there is NO trick / method that will work for all possible errors.




Charlie
===============================================================
Msg 3903, Level 16, State 1, Line 1736
The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000