Posted by Erland Sommarskog on 01/10/07 08:19
(othellomy@yahoo.com) writes:
> When I execute the following query:
> select name
> from sysobjects
> where object_id('sysobjects') = 1
> Why do I get all the rows instead of only one?
You would get either many or zero rows, depending on the object id of
sysobjects. On SQL 2000 the query returns many rows, so obviously sysobjects
has id = 1 there. On SQL 2005 you get no rows at all. (On SQL 2005
sysobjects is no longer a table.)
>Because when I tried to run a similar query (to test) on
>another server (sql Anywhere)
SQL Anywhere is an entirely different engine, alhough I can guess that
Sybase has added sysobjects & co since they acquired the product.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
[Back to original message]
|