Skip to main content
added tag
Link
John K. N.
  • 18.3k
  • 14
  • 54
  • 115
added 69 characters in body; edited title
Source Link
Evan Carroll
  • 64.7k
  • 49
  • 251
  • 496

What is the difference between Making sense of sys.objects and, sys.system_objects, and sys.sysobjects?

In this question I was writing a query using sys.sysobjects. However, one of the answers mentioned sys.system_objects. I'm just wondering what is the difference between the twothese tables?

  • sys.sysobjectsobjects
  • sys.system_objects
  • sys.sysobjects

sysobjects has more things.

> SELECT count(*) FROM sysobjects;
2312

> SELECT count(*) FROM sys.system_objects;
2201

> SELECT count(*) FROM sys.objects;
> 111

SELECT count(*)
FROM sys.sysobjects
WHERE NOT EXISTS (
  SELECT 1
  FROM sys.system_objects
  WHERE system_objects.object_id = sysobjects.id
);
> 111

What is the difference between sys.objects and sys.system_objects?

In this question I was writing a query using sys.sysobjects. However, one of the answers mentioned sys.system_objects. I'm just wondering what is the difference between the two tables?

  • sys.sysobjects
  • sys.system_objects

sysobjects has more things.

> SELECT count(*) FROM sysobjects;
2312

> SELECT count(*) FROM sys.system_objects;
2201

SELECT count(*)
FROM sys.sysobjects
WHERE NOT EXISTS (
  SELECT 1
  FROM sys.system_objects
  WHERE system_objects.object_id = sysobjects.id
);
> 111

Making sense of sys.objects, sys.system_objects, and sys.sysobjects?

In this question I was writing a query using sys.sysobjects. However, one of the answers mentioned sys.system_objects. I'm just wondering what is the difference between these tables?

  • sys.objects
  • sys.system_objects
  • sys.sysobjects

sysobjects has more things.

> SELECT count(*) FROM sysobjects;
2312

> SELECT count(*) FROM sys.system_objects;
2201

> SELECT count(*) FROM sys.objects;
> 111

SELECT count(*)
FROM sys.sysobjects
WHERE NOT EXISTS (
  SELECT 1
  FROM sys.system_objects
  WHERE system_objects.object_id = sysobjects.id
);
> 111
Tweeted twitter.com/StackDBAs/status/943222341089275905
added 211 characters in body
Source Link
Evan Carroll
  • 64.7k
  • 49
  • 251
  • 496

In this question I was writing a query using sys.sysobjects. However, one of the answers mentioned sys.system_objects. I'm just wondering what is the difference between the two tables?

  • sys.sysobjects
  • sys.system_objects

sysobjects has more things.

> SELECT count(*) FROM sysobjects;
2312

> SELECT count(*) FROM sys.system_objects;
2201

But the following query returns 0

 
SELECT count(*)
FROM sys.sysobjects
WHERE NOT EXISTS (
  SELECT 1
  FROM sys.system_objects
  WHERE system_objects.object_id <>= sysobjects.id
);

But there are no dupes or nulls

SELECT id, count(*) FROM sys.sysobjects GROUP BY id HAVING count(*) > 1;
(0 rows affected)
SELECT * FROM sys.sysobjects WHERE id IS NULL;
(0 rows affected)111

In this question I was writing a query using sys.sysobjects. However, one of the answers mentioned sys.system_objects. I'm just wondering what is the difference between the two tables?

  • sys.sysobjects
  • sys.system_objects

sysobjects has more things.

> SELECT count(*) FROM sysobjects;
2312

> SELECT count(*) FROM sys.system_objects;
2201

But the following query returns 0

SELECT *
FROM sys.sysobjects
WHERE NOT EXISTS (
  SELECT 1
  FROM sys.system_objects
  WHERE system_objects.object_id <> sysobjects.id
);

But there are no dupes or nulls

SELECT id, count(*) FROM sys.sysobjects GROUP BY id HAVING count(*) > 1;
(0 rows affected)
SELECT * FROM sys.sysobjects WHERE id IS NULL;
(0 rows affected)

In this question I was writing a query using sys.sysobjects. However, one of the answers mentioned sys.system_objects. I'm just wondering what is the difference between the two tables?

  • sys.sysobjects
  • sys.system_objects

sysobjects has more things.

> SELECT count(*) FROM sysobjects;
2312

> SELECT count(*) FROM sys.system_objects;
2201
 
SELECT count(*)
FROM sys.sysobjects
WHERE NOT EXISTS (
  SELECT 1
  FROM sys.system_objects
  WHERE system_objects.object_id = sysobjects.id
);
> 111
added 211 characters in body
Source Link
Evan Carroll
  • 64.7k
  • 49
  • 251
  • 496
Loading
Source Link
Evan Carroll
  • 64.7k
  • 49
  • 251
  • 496
Loading