Sybase ASE
All versions
Last updated: 06 December 2004
ASE Quiz Questions 2003
 
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.


December 2003: a special Christmas Quiz Question
The last quiz question of 2003 is a Christmas special: you can win a prize if you know the right answer!

The problem: In an ASE 12.5 database, there is a normal user table (i.e. not a proxy table) called xmasquiz, with a single column a. This table contains a fixed set of rows, and is not modified in any way. Yet, when running the query select * from xmasquiz, a different set of rows seems to be returned each time. Strange, eh?

You can see this behaviour for yourself, by following this link: this will actually run the query select * from xmasquiz, and show the results.

The question: How do you explain this behaviour?

Go here for the answer (and the prize winners).

November 2003
Suppose you're an ASE DBA, and you have been hired to replace another DBA who left abruptly. Once you've managed to log into the ASE server (see the question for September 2003 for more on that), one of the things you'll want to know about this server is which configuration parameters have been set to non-default values (i.e. which parameters have been changed by the DBA). How can this be determined most efficiently?

Go here for the answer.

October 2003
Syntax errors normally cause the execution of SQL code to be aborted. However, syntax errors can also have unexpected side-effects. Can you see the difference between the following batches, which both contain incorrect syntax?
-- batch 1
insert MyTable   
vlaues (1)      -- should have been 'values'
select * from MyTable
go

-- batch 2
inset MyTable   -- should have been 'insert'
select Col from YourTable
select * from MyTable
go
(Hint: there are no tricks with the tables themselves: MyTable and YourTable both exist and contain a single int column named Col)

Go here for the answer.

September 2003
Suppose you're an ASE DBA, and you have been hired to replace a DBA who was fired rather abruptly. Your first task is to change the production ASE server's sa password. However, you don't know the current sa password to start with -- and nobody else knows it either (let's assume the fired DBA isn't available for questions).
You know that a new sa password can be generated by starting ASE with the command-line option -p, but this requires that you shut down the server first.

What is the most safe and elegant way of stopping ASE without knowing the ASE password?

Go here for the answer.

August 2003
When creating a table, a name and a datatype are usually specified for each column, i.e:
create table MyTable (MyColumn int)
However, in some cases, it is not necessary to specify both a name and a datatype, and the latter can be omitted. Do you know when this is possible?

Go here for the answer.

July 2003
As every ASE DBA knows, changing the value of a static configuration parameter requires an ASE restart for the change to become effective.
There is a particular static configuration parameter that requires not one, but two ASE restarts before its value is effectively changed. Do you know which one?

Go here for the answer.

June 2003
Since version 11.9, ASE supports datapages and datarows locking as well as the classic allpages lock scheme. Data-only locking (the collective name for datapages and datarows), abbreviated DOL, is functionally identical to allpages (APL) but offers better concurrency and some additional functionality that APL doesn't have (such as reorg rebuild table_name index_name).

The question: which functionality cannot be implemented for a DOL table (or in a clumsy way at best), while this is easy for an APL table?
(note: this is a question for true ASE-diehards, since the answer is rather technical...)

Go here for the answer.

May 2003
As we all know, probably through finding out the hard way, you cannot create a table inside a trigger since DDL is not allowed in a transaction by default. To allow this anyway, you need to enable the database option ddl in tran.

The question: how can you create a table from within a trigger without using ddl in tran ?
(hint: this is already possible since at least version 10, so it doesn't involve CIS...)

Go here for the answer.

April 2003

It is common knowledge that select * will display all columns in a table.
But is this always true? Is it possible to create 'hidden' columns?

Go here for the answer.

March 2003

The ASE system stored procedures are usually named quite logically.
What do sp_reportstats, sp_clearstats, sp_flushstats, sp_modifystats and sp_object_stats have in common?

Go here for the answer.

February 2003
Recently, I was writing some SQL code where I needed to do X%100 ('X modulo 100'), where X was of the numeric(10) datatype. Because -unfortunate but true- ASE allows the modulo operator only on int, smallint or tinyint datatypes, I had to implement this function myself.
This should have been a simple, 30-second job: the following expression is equivalent to X%100:
select @X - ((@X/100)*100)
However, this did not work as expected: this expression always returns 0 for numeric datatypes. Why?

Go here for the answer.

January 2003
A close and trusted friend, who works at a different company, has given you the source code for some handy DBA stored procedures which he's written himself. He assures you that the SQL code is valid Transact-SQL. Still, when executed in your ASE 12.5 server, his code causes many syntax errors. Your conclusion is that it is not Transact-SQL-compliant.
Is your friend a liar, a terrible programmer, or is your own judgement flawed?

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 www.sypron.nl/quiz2003.html