Thursday, March 29, 2012

error finding in SQL server

hi,

Is there an equivalent function in SQL server as to MYsql's
mysql_error() for easy findings of SQL errors? Couldn't find it in the
manual... If no : What if the recommended action to take?

My SQL statement DIE's when I use it on my php page, but works fine in
the MS SQL query analyzer.

obscurrObscurr (obscurr@.hotmail.com) writes:
> Is there an equivalent function in SQL server as to MYsql's
> mysql_error() for easy findings of SQL errors? Couldn't find it in the
> manual... If no : What if the recommended action to take?
> My SQL statement DIE's when I use it on my php page, but works fine in
> the MS SQL query analyzer.

Since I don't know PHP and I don't know MySQL, I may not be giving
you the right answer.

In general, SQL Server's error handling is fairly poor, and you are
supposed to check @.@.error in your SQL code, and always have the
client code to cover up for you. If your SQL statement fails when
running it from PHP, you probably need to find out how to catch
the error in PHP.

--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

No comments:

Post a Comment