5

can anybody tell me what are valid values for the flags parameter of the

sp_MSdependencies stored procedure

and especially what do they mean.

BenMorel
  • 34,448
  • 50
  • 182
  • 322
Dimi Takis
  • 4,924
  • 3
  • 29
  • 41

1 Answers1

8

Running this will enumerate the options for you.

exec sp_MSdependencies '?'

Returns:

sp_MSobject_dependencies name = NULL, type = NULL, flags = 0x01fd
  name:  name or null (all objects of type)
  type:  type number (see below) or null
      if both null, get all objects in database
  flags is a bitmask of the following values:
      0x10000  = return multiple parent/child rows per object
      0x20000  = descending return order
      0x40000  = return children instead of parents
      0x80000  = Include input object in output result set
      0x100000 = return only firstlevel (immediate) parents/children
      0x200000 = return only DRI dependencies
      power(2, object type number(s))  to return in results set:
          0 (1      - 0x0001)    - UDF
          1 (2      - 0x0002)    - system tables or MS-internal objects
          2 (4      - 0x0004)    - view
          3 (8      - 0x0008)    - user table
          4 (16     - 0x0010)    - procedure
          5 (32     - 0x0020)    - log
          6 (64     - 0x0040)    - default
          7 (128    - 0x0080)    - rule
          8 (256    - 0x0100)    - trigger
          12 (1024  - 0x0400) - uddt
      shortcuts:
          29     (0x011c) - trig, view, user table, procedure
          448   (0x00c1) - rule, default, datatype
          4606 (0x11fd) - all but systables/objects
          4607 (0x11ff) - all
Joe Stefanelli
  • 132,803
  • 19
  • 237
  • 235
  • That's amazing, didn't know about '?' parameter. For a moment I thought that it could be used everywhere, but it seems that its just an exception. I am using 1315327 flag (0x1411FF). I randomly tried others 0x415FF and I don't know how they are added, it doesn't make much sense to me and it looks like its deprecated and there is no documentation. – Dalton Sep 20 '22 at 07:29