Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Applies to:
SQL Server
Azure SQL Managed Instance
Removes an assembly and all its associated files from the current database. Assemblies are created by using CREATE ASSEMBLY and modified by using ALTER ASSEMBLY.
Transact-SQL syntax conventions
DROP ASSEMBLY [ IF EXISTS ] assembly_name [ , ...n ]
[ WITH NO DEPENDENTS ]
[ ; ]
Applies to: SQL Server 2016 (13.x) and later versions.
Conditionally drops the assembly only if it already exists.
The name of the assembly you want to drop.
If specified, WITH NO DEPENDENTS
drops only assembly_name, and none of the dependent assemblies referenced by the assembly. If not specified, DROP ASSEMBLY
drops assembly_name and all dependent assemblies.
Dropping an assembly removes an assembly and all its associated files, such as source code and debug files, from the database.
If WITH NO DEPENDENTS
isn't specified, DROP ASSEMBLY
drops assembly_name and all dependent assemblies. If an attempt to drop any dependent assemblies fails, DROP ASSEMBLY
returns an error.
DROP ASSEMBLY
returns an error if the assembly is referenced by another assembly that exists in the database or if it's used by common language runtime (CLR) functions, procedures, triggers, user-defined types, or aggregates in the current database.
DROP ASSEMBLY
doesn't interfere with any code referencing the assembly that is currently running. However, after DROP ASSEMBLY
executes, any attempts to invoke the assembly code will fail.
Requires ownership of the assembly, or CONTROL
permission on it.
The following example assumes the assembly HelloWorld
is already created in the instance of SQL Server.
DROP ASSEMBLY Helloworld;
Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register today