We all know that user-defined (UDT) SQL table value table types cannot be deleted if they have dependencies / dependencies. Correctly.
But today I left him, even if they have dependents. Only criteria - they should not be used as parameters of database objects, such as proc or func.
CREATE TYPE FooUDT AS TABLE ( ID int NOT NULL )
According to
CREATE PROCEDURE Bar as BEGIN DECLARE @Identifier FooUDT
FooUDT can be dropped because it is used internally by proc and is not a parameter. But in the following way it cannot be discarded.
CREATE PROCEDURE Bar @Identifier FooUDT readonly as BEGIN
What is even more interesting is that in both cases, if we check the dependencies, both will show each other. But the first case can be discarded, but not the last. Why is this? Or am I missing something?
sql sql-server tsql user-defined-types
Nikhil Agrawal
source share