Sybase ASE
All versions
Last updated: 26 November 2006
ASE Quiz Questions 2006
This page contains some quiz-type ASE questions to test your ASE knowledge.
More ASE quiz questions: 2013 - 2012 - 2011 - 2010 - 2009 - 2008 - 2007 - 2006 - 2005 - 2004 - 2003 - 2002 - 2001
For a randomly selected quiz question, click here.

November 2006
In ASE, it's quite easy to write a custom string to the ASE errorlog from SQL. An application is the errorlog checking tool described here.
I have received numerous requests from RepServer DBAs to make this tool work for RepServer errorlogs as well. Which brings me to this month's question: how can you write an arbitrary string to the RepServer errorlog in a programmatically controlled way?

Go here for the answer.

October 2006
As we all know, when writing a SQL statement it doesn't really matter in what order you list the tables in the from-clause; this has no impact on the query's result set.
However, there happens to be a situation where the order of the various parts in the from-clause of a select statement does actually make a difference for syntactical correctness. Do you know which?

Go here for the answer.

August 2006
We're always looking for ways to make queries run faster, or keep the response time below an certain maximum.
But what if you'd want to do the reverse, and actually want to make a query take at least some minimum amount of time to respond? How would you do that?
(NB: this is not as crazy an idea as it may sound -- see the answer).

Go here for the answer.

July 2006
Some time ago, I was installing an EBF in my ASE server. As you know, part of this procedure is to run the installmaster, installsecurity, installmontables (etc) scripts after booting the ASE server with the new EBF.
Since I was in a rush, I kicked off two parallel isql sessions, one doing installmaster and one doing installsecurity, since this seemed a quicker way of completing the job.
Later, various system stored procedures (like sp_poolconfig and sp_modifylogin, but many others too) produced permission errors when I ran it. Why was that?

Go here for the answer.

June 2006
An insert trigger is created on a table as follows:
create trigger MyTrigger on MyTable for insert
  select * from inserted
Now, when inserting a row, the trigger returns an empty result set, suggesting that no data was found in the inserted table. However, the row itself appears to have been inserted OK:
1> insert MyTable (a, b) values (12345, 'inserting 12345')
2> go
 a           b
 ----------- --------------------

(0 rows affected)

(1 row affected)
1> select * from MyTable where a = 12345
2> go
 a           b
 ----------- --------------------
       12345 inserting 12345

(1 row affected)
How do you explain that while a row is inserted perfectly fine, the insert trigger does not see the inserted data, even though the trigger is fired as expected?

Go here for the answer.

May 2006
As you've noticed, there hasn't been a quiz question in May. This was due to vacation and spending the rest of my time on the new editions of 'Tips, Tricks & Recipes for Sybase ASE' and 'The Complete Sybase ASE Quick Reference Guide'. Stay tuned...
April 2006
A well-known way to determine the elapsed time for your queries is to run set statistics time on. This requires modifying the executed SQL script since set statistics time on is a SQL command that must be executed in order to have any effect.

How can you determine the elapsed time for the queries in your session, without involving any SQL commands at all?

Go here for the answer.

March 2006
Some years ago, while in the middle of a troubleshooting operation involving a corrupt database, something happened that my heart skip a beat. I had just run sp_helpdb, and the result looked something like this:
1> sp_helpdb
2> go
 name                     db_size       owner                    dbid
 ------------------------ ------------- ---------------------- ------
 PROD                         2500.0 MB sa                          9
         Mar 18, 2004
         abort tran on log full

 REPORTING                    4000.0 MB sa                         11
         Mar 22, 2004
         select into/bulkcopy/pllsort, abort tran on log full

 dbccdb                       1200.0 MB sa                      31516
         Jun 29, 2004
         trunc log on chkpt

(1 row affected)
(return status = 0)
There were only 3 databases in my server! What had happened to my master database and other databases?? This corruption problem seemed to be getting out of hand...
Panicking, I ran sp_helpdb again, only to find those same three databases again. Getting down to basics, I did a select * from sysdatabases -- but still, it showed only those three databases. HELP!?!?

Any clues?

Go here for the answer.

January/February 2006
Let's assume you need to generate 100000 row inserts for testing the throughput of insert statements by ASE. In the spirit of the quiz question for May 2005, you're doing this as follows:
1> insert MyTable values (....)
2> go 100000
Is this a good approach for performance testing?

Go here for the answer.

More ASE quiz questions: 2013 - 2012 - 2011 - 2010 - 2009 - 2008 - 2007 - 2006 - 2005 - 2004 - 2003 - 2002 - 2001
For a randomly selected quiz question, click here.

 This document is located at