Friday, March 30, 2012

Run-time Error Vs. Compile Error!

How to understand whether an error is a run-time error or a compile
error?
Thanks,
ArpanCan you be more specific with your question? A compile error is a syntax
error. A good way to check this is to press the little check mark button in
QA and see if it compiles. Different objects/batches have different compile
requirements. One the code compiles, the next thing is to build a plan, and
the execute. Errors that happen here are considered run-time errors.
Do you have a specific situation that concerns you?
----
Louis Davidson - http://spaces.msn.com/members/drsql/
SQL Server MVP
"Arpan" <arpan_de@.hotmail.com> wrote in message
news:1123287800.195685.193030@.g44g2000cwa.googlegroups.com...
> How to understand whether an error is a run-time error or a compile
> error?
> Thanks,
> Arpan
>|||Thanks, Louis, for your response. So does compile errors ALWAYS mean
there are some syntax errors i.e. aren't there any other types of
errors (of course, excluding run-time errors) that are considered to be
compile errors?
No, my question is not concerned to any specific situation.
Thanks once again,
Regards,
Arpan|||See the following article by Erland Sommarskog, SQL Server MVP:
http://www.sommarskog.se/error-handling-I.html
(particulary the "Scope Abortion" section)
Razvan|||Definitely read Erland's stuff, but syntax, bad column names, (bad table
names can be ignored for delayed resolution to allow for temporary tables)
that sort of thing. Anything that makes your code unintelligible to SQL
Server. If SQL Server recognizes the syntax like you cannot say IF
condition THEN (it will squawk.) even though IF and THEN are valid in other
places.
Once it feels it likes the syntax, it runs it and everything else is
run-time in that the compiler didn't see the problem, but the query engine
does..
----
Louis Davidson - http://spaces.msn.com/members/drsql/
SQL Server MVP
"Arpan" <arpan_de@.hotmail.com> wrote in message
news:1123294036.972006.25270@.g14g2000cwa.googlegroups.com...
> Thanks, Louis, for your response. So does compile errors ALWAYS mean
> there are some syntax errors i.e. aren't there any other types of
> errors (of course, excluding run-time errors) that are considered to be
> compile errors?
> No, my question is not concerned to any specific situation.
> Thanks once again,
> Regards,
> Arpan
>

No comments:

Post a Comment