Showing posts with label appear. Show all posts
Showing posts with label appear. Show all posts

Sunday, March 25, 2012

Abend info in SQL Log

Is there a way to get application/sql query abends to appear in the SQL error
log?
For example, we have an application that executes a SQL query. The
application will abend because the query failed (invalid object, Foreign key
conflict ...). Can we change a setting in SQL to see these errors in the
error log?Hi
No. If you need to see failed queries, you need to run SQL Server Profiler.
Regards
--
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/
"vtcs212" <vtcs212@.discussions.microsoft.com> wrote in message
news:72A431E7-5581-435D-A6C9-3253A30692BB@.microsoft.com...
> Is there a way to get application/sql query abends to appear in the SQL
> error
> log?
> For example, we have an application that executes a SQL query. The
> application will abend because the query failed (invalid object, Foreign
> key
> conflict ...). Can we change a setting in SQL to see these errors in the
> error log?

Abend info in SQL Log

Is there a way to get application/sql query abends to appear in the SQL error
log?
For example, we have an application that executes a SQL query. The
application will abend because the query failed (invalid object, Foreign key
conflict ...). Can we change a setting in SQL to see these errors in the
error log?
Hi
No. If you need to see failed queries, you need to run SQL Server Profiler.
Regards
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/
"vtcs212" <vtcs212@.discussions.microsoft.com> wrote in message
news:72A431E7-5581-435D-A6C9-3253A30692BB@.microsoft.com...
> Is there a way to get application/sql query abends to appear in the SQL
> error
> log?
> For example, we have an application that executes a SQL query. The
> application will abend because the query failed (invalid object, Foreign
> key
> conflict ...). Can we change a setting in SQL to see these errors in the
> error log?
sql

Abend info in SQL Log

Is there a way to get application/sql query abends to appear in the SQL erro
r
log?
For example, we have an application that executes a SQL query. The
application will abend because the query failed (invalid object, Foreign key
conflict ...). Can we change a setting in SQL to see these errors in the
error log?Hi
No. If you need to see failed queries, you need to run SQL Server Profiler.
Regards
--
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/
"vtcs212" <vtcs212@.discussions.microsoft.com> wrote in message
news:72A431E7-5581-435D-A6C9-3253A30692BB@.microsoft.com...
> Is there a way to get application/sql query abends to appear in the SQL
> error
> log?
> For example, we have an application that executes a SQL query. The
> application will abend because the query failed (invalid object, Foreign
> key
> conflict ...). Can we change a setting in SQL to see these errors in the
> error log?

Thursday, February 16, 2012

A new one on me!

I came across a select statement that has me all ! There is a
reference to a table in a case clause which does not appear anywhere else in
the Select. In the example below, TableC is a regular database table which
does not appear in the From or the where or anywhere else. I had no idea
this can be done and I have no idea what it is really doing. Any suggestions
?
Perplexed!
Select
.
.
CASE WHEN TableC.SaleDate IS NOT NULL THEN 1 ELSE 0 END 'IsSold',
. .
From tableA, tableB
Where . . .Could you post a complete query rather than a fragment? DDL might help
too.
You can't reference a table name / alias unless A) that name is
included in a FROM / JOIN clause in the same query / subquery OR B) the
name Exists in an outer part of the query and is referenced in a
subquery. I can't think of any exceptions.
David Portas
SQL Server MVP
--