Issue
According to docs I can specify several files for one assembly:
FROM { <client_assembly_specifier> | <assembly_bits> [ ,...n ] }
But this query:
CREATE ASSEMBLY [test]
FROM
'C:\temp\MyAssembly.dll',
'C:\temp\MyAssembly2.dll'
WITH PERMISSION_SET = SAFE;
returns an error:
CREATE ASSEMBLY failed because the assembly source parameter 2 is not a valid expression.
What is wrong in this query?
Solution
You're misreading it, slightly.
The options are:
<client_assembly_specifier>
or,
<assembly_bits> [ ,...n ] }
As clarified by:
<client_assembly_specifier>can be expressed as a fixed string or an expression evaluating to a fixed string, with variables. CREATE ASSEMBLY does not support loading multimodule assemblies. SQL Server also looks for any dependent assemblies of this assembly in the same location and also uploads them with the same owner as the root level assembly
and,
<assembly_bits>Is the list of binary values that make up the assembly and its dependent assemblies.
If either option was allowed to be repeated, I believe you would see it specified as:
{ <client_assembly_specifier> | <assembly_bits> } [ ,...n ]
See also Transact-SQL Syntax Conventions (Transact-SQL):
[,...n]Indicates the preceding item can be repeated n number of times. The occurrences are separated by commas.
(my emphasis)
Answered By - Damien_The_Unbeliever Answer Checked By - Willingham (sql.easybugfix Volunteer)
Post a Comment
Post a Comment