How to alter assembly ?

Hania ABECHE 0 Reputation points
2023-06-01T14:03:06.1533333+00:00

i was trying to alter an assembly in sql server , but it always return an error that i dont have permissions or it doest not exist ( i verified that it exist already and verified all the persmissions needed ) is there in solution ?

i tried both ways via query and via GUI .

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,293 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Ronen Ariely 15,101 Reputation points
    2023-06-01T17:32:08.45+00:00

    Hi,

    the basic code is like:

    ALTER ASSEMBLY ComplexNumber 
    FROM 'C:\Program Files\Microsoft SQL Server\130\Tools\Samples\1033\Engine\Programmability\CLR\UserDefinedDataType\CS\ComplexNumber\obj\Debug\ComplexNumber.dll'
    
    

    For full documentations and sample code, check this:

    https://learn.microsoft.com/en-us/sql/t-sql/statements/alter-assembly-transact-sql?view=sql-server-ver16&WT.mc_id=DP-MVP-5001699

    0 comments No comments

  2. Erland Sommarskog 106.2K Reputation points MVP
    2023-06-01T21:09:09.89+00:00

    Change the ALTER ASSEMBLY statement to CREATE ASSEMBLY to find out which part of the error message that is true. If CREATE completes successfully, the assembly did not exist after all. (Maybe you are in the wrong database.) And if you don't have permission, you will get a permission error.

    0 comments No comments

  3. PercyTang-MSFT 12,426 Reputation points Microsoft Vendor
    2023-06-02T02:20:05.01+00:00

    Hi @Hania ABECHE

    Do you use sys.assemblies to check if it exists? It returns relevant information.

    https://learn.microsoft.com/en-us/sql/relational-databases/system-catalog-views/sys-assemblies-transact-sql?view=sql-server-ver16

    Best regards,

    Percy Tang

    0 comments No comments