This did not work.
Nor did
ALTER ASSEMBLY DROP FILE ALL ADD FILE FROM 'somefile.dll'
Nor did just
ALTER ASSEMBLY DROP FILE 'somefile.dll'
or
ALTER ASSEMBLY DROP FILE ALL
The message I get for:
alter assembly someCLR
drop file 'C:\Program Files\hello\MsSqlProvider\MSSQL05\somefile.dll'
is
Assembly "someCLR" does not have an associated file "C:\Program
Files\hello\MsSqlProvider\MSSQL05\somefile.dll".
However, somefile.dll still shows up in
SELECT * FROM sys.assembly_files
I have even pasted the results from this select into the DROP FILE in case
there is a spelling error. Is this a known issue? Are there situations
where the file cannot be dropped because functions refer to implemetations
within the files (but that just the error message is misleading)
1. I am able to drop other files in the same assembly using the ALTER
ASSEMBLY. The problem is specific to a particular file.
2. In the original post, the syntax (accidentally) omitted the assembly
name. The actual SQL used did not have this or any other syntax error.
i.e. instead of
ALTER ASSEMBLY someCLR DROP FILE 'somefile.dll' ADD FILE FROM 'somefile.dll'
I wrote
ALTER ASSEMBLY DROP FILE 'somefile.dll' ADD FILE FROM 'somefile.dll'
I always do it with
ALTER ASSEMBLY FROM '<filepath>'
That's all. I see that Books Online says this is only possible when there
are no associated files with the assembly.
In the same vein ADD/DROP FILE appears to be for associated files only.
Is your assembly a single-file assembly?
--
Erland Sommarskog, SQL Server MVP, esq...@sommarskog.se
Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Then, when I do a DROP ALL (so that I could follow this with an ADD), it
only dropped the new one I just added (with file id 2), and kept the old one
with the same name (which has a file id of 1).
ALTER ASSEMBLY FROM '<filepath>'
I get this:
Msg 6285, Level 16, State 1, Line 1
ALTER ASSEMBLY failed because the source assembly is, according to MVID,
identical to an assembly that is already registered under the name "someCLR".
Cheers,
Bob Beauchemin
"udf.learner" <udfle...@discussions.microsoft.com> wrote in message
news:1B27F912-236C-4D2A...@microsoft.com...
As for SQL Server feels compelled to give you an error for this, I don't
know. I might have received some explanation for it in the past, but in
that case I've forgotten it.