title: SQL User Defined Table Types: Why can we drop them if not used as parameter?
body: <p>We all know that SQL User Defined Table Value Table Types (UDT) cannot be dropped if they have dependents/dependencies. Right.</p>
  
  <p>But, today I dropped one even if they have dependents. Only criteria is they should not be used as parameters of DB objects like proc or func. </p>
  
  <pre><code>CREATE TYPE FooUDT AS TABLE
  (
    ID int NOT NULL
  )
  </code></pre>
  
  <p>Dependent</p>
  
  <pre><code>CREATE PROCEDURE Bar
  as
  BEGIN
      DECLARE @Identifier FooUDT
  
      --Some operations on @Identifier
  END
  GO
  </code></pre>
  
  <p>The <code>FooUDT</code> can be dropped as it is used inside a proc and is not a parameter. But following way it cannot be dropped.</p>
  
  <pre><code>CREATE PROCEDURE Bar 
      @Identifier FooUDT readonly
  as
  BEGIN
      --Some operations on @Identifier
  END
  GO
  </code></pre>
  
  <p><strong>What's more interesting is that in both cases, if we check the dependencies, both will show each other name. Yet the former case can be dropped but not the latter.</strong> Why this? Or am I missing something?</p>