March 29, 2008 at 10:39 pm
Hi,
I think question and answer aren't synchronous.
If it is question for SQL 2005 Server then good answer is:
"Msg 208, Level 16, State 1, Line 1
Invalid object name 'Employee'."
If your default Schema is not Schema to which employee table belongs.
If it is question for SQL 2000 Server (what syntax suggest :)) then good answer is:
"All columns and all rows from the employee table in descending start_date order, with the start_date as the first column"
March 30, 2008 at 1:40 am
For SQL SERVER 2000 it will work
March 30, 2008 at 1:53 pm
For SQL Server 2000 the statement will succeed... For SQL 2005 you need to qualify the Order by statement with the table name. This question should have been written more clearly.
Thanks
Un happy Member (I answered it from a 2000 point of view)
Thanks
March 30, 2008 at 11:29 pm
Dear Friend,
Please provide all the information about the situtation and/or enviorment :).
It will work perfectly fine with SQL Server 2000.:D
But not with SQL Server 2005.
Thanks.
Regards,
March 30, 2008 at 11:41 pm
Hi all
The suggested Answer is wrong
March 31, 2008 at 1:02 am
i do not think it's a matter of sql server version. ideally you/we should be able to answer without running the command.
but if you still want to run it, no one prevents you from adapting the script to match your (test) environment, table names, column names... etc
dragos
March 31, 2008 at 1:03 am
This works OK in SQL server 2000.
The question didn't specify which SQL version.
😎
March 31, 2008 at 1:36 am
Hmm.
We have a multiple guess question that asks, "if you do this, what'll happen?". There isn't an option for, "in some situations this, in others that", so either there are two right answers or there aren't any.
Unfortunately, the QOTD, whilst only being a bit of fun (and good fun at that), suffers from rather frequent bad phrasing. I suspect Steve simply hasn't the time for the required level of sanity-checking.
Semper in excretia, suus solum profundum variat
March 31, 2008 at 1:41 am
Hi,
The question is not version specific. Please make sure to mention the version on the future questions.
March 31, 2008 at 1:45 am
I try with SQL 2005 and that works perfectly.
March 31, 2008 at 1:48 am
@kenny, is the database you tried your query against set at compatibility level 8.0? If so, you're right that it'll work fine. However, changing the compatibility level to 9.0 (obviously not on a db of any kind of importance if you're changing just to answer a QOTD ;)), it'll give the error stated as being the correct answer.
Semper in excretia, suus solum profundum variat
March 31, 2008 at 2:02 am
Hi,
The suggessted answer is wrong, For SQL server 2000 the query runs successfully without any error and the option A is correct.
March 31, 2008 at 2:14 am
Another way of doing this is
select start_date as [Date], *
from employee
order by [Date] desc
Viewing 15 posts - 1 through 15 (of 182 total)
You must be logged in to reply to this topic. Login to reply