|
Posted by othellomy on 01/10/07 09:56
Okay. Since we are on the subject, I fail to understand why SQL Server
2K would return more than one row. If object_id('sysobejcts')
returns 1 then there is only one row with that id in sysobjects table.
I would like to look at the code of object_id() and what datatype it
returns only if I can find it! (That's a different issue)
Erland Sommarskog wrote:
> (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
Navigation:
[Reply to this message]
|