Home All Groups Group Topic Archive Search About

CREATE ASSEMBLY failed because it could not open the physical file

Author
7 Apr 2006 1:58 AM
AJang
Scenario:
Server: windows server 2003 with sqlexpress installed,named serverA.
Client: windows xp, named clientB
problem:Want to create assembly from a assembly dll file located in client
machine.

I use statement
Create assembly foo from '<PATHFILE>'
to create assembly in database.

If <PATHFILE> is the absolute path of serverA, every thing is ok.

If <PATHFILE> is in Shared Directory of clientB, such as
\\clientB\SharedDocs\routine.dll, the following message appeared:

CREATE ASSEMBLY failed because it could not open the physical file
'\\clientB\SharedDocs\routine.dll': 5(access denied).

How to fix it ? Thanks.

Ajang

Author
7 Apr 2006 4:17 AM
SriSamp
Here is what BOL says:
=====
When attempting to access the assembly specified in
<client_assembly_specifier>, SQL Server impersonates the security context of
the current Windows login. If <client_assembly_specifier> specifies a
network location (UNC path), the impersonation of the current login is not
carried forward to the network location because of delegation limitations.
In this case, access is made using the security context of the SQL Server
service account.
=====
You need to ensure that proper permissions are present.
Show quoteHide quote
"AJang" <AJ***@discussions.microsoft.com> wrote in message
news:A89D695D-F76C-43B0-8C88-EFFD352E5531@microsoft.com...
> Scenario:
> Server: windows server 2003 with sqlexpress installed,named serverA.
> Client: windows xp, named clientB
> problem:Want to create assembly from a assembly dll file located in client
> machine.
>
> I use statement
> Create assembly foo from '<PATHFILE>'
> to create assembly in database.
>
> If <PATHFILE> is the absolute path of serverA, every thing is ok.
>
> If <PATHFILE> is in Shared Directory of clientB, such as
> \\clientB\SharedDocs\routine.dll, the following message appeared:
>
> CREATE ASSEMBLY failed because it could not open the physical file
> '\\clientB\SharedDocs\routine.dll': 5(access denied).
>
> How to fix it ? Thanks.
>
> Ajang
>
Are all your drivers up to date? click for free checkup

Author
7 Apr 2006 5:11 AM
Martin C K Poon @ Hong Kong
This should be access right problem. Seems that SQL Server uses the security
context of the SQL Server service account to access the network loation (UNC
path).

--
Martin C K Poon
Senior Analyst Programmer
==============================


"AJang" <AJ***@discussions.microsoft.com> ¼¶¼g©ó¶l¥ó·s»D:A89D695D-F76C-43B0-8C88-EFFD352E5***@microsoft.com...
Scenario:
Server: windows server 2003 with sqlexpress installed,named serverA.
Client: windows xp, named clientB
problem:Want to create assembly from a assembly dll file located in client
machine.

I use statement
Create assembly foo from '<PATHFILE>'
to create assembly in database.

If <PATHFILE> is the absolute path of serverA, every thing is ok.

If <PATHFILE> is in Shared Directory of clientB, such as
\\clientB\SharedDocs\routine.dll, the following message appeared:

CREATE ASSEMBLY failed because it could not open the physical file
'\\clientB\SharedDocs\routine.dll': 5(access denied).

How to fix it ? Thanks.

Ajang
Author
7 Apr 2006 7:52 AM
AJang
In fact, ServerA is a domain controller of domain TEST,ClientB is a member
machine of TEST.

In ServerA's active directory, in users group, there are groups such as

SQLServer2005MSSQLServerADHelperUser$serverA
SQLServer2005MSSQLUser$serverA$SQLEXPRESS
SQLServer2005SQLBrowserUser$serverA

I can't locate the "SQL Server service account" in active directory.

In \\clientB\SharedDocs properies page, security tab," everyone" and
"serverA\Domain users" have permissions READ/EXECUTE/Browse.

The error message are the same.
How to solve the access right problem?

Ajang



Show quoteHide quote
"Martin C K Poon @ Hong Kong" wrote:

> This should be access right problem. Seems that SQL Server uses the security
> context of the SQL Server service account to access the network loation (UNC
> path).
>
> --
> Martin C K Poon
> Senior Analyst Programmer
> ==============================
>
>
> "AJang" <AJ***@discussions.microsoft.com> ¼¶¼g©ó¶l¥ó·s»D:A89D695D-F76C-43B0-8C88-EFFD352E5***@microsoft.com...
> Scenario:
> Server: windows server 2003 with sqlexpress installed,named serverA.
> Client: windows xp, named clientB
> problem:Want to create assembly from a assembly dll file located in client
> machine.
>
> I use statement
> Create assembly foo from '<PATHFILE>'
> to create assembly in database.
>
> If <PATHFILE> is the absolute path of serverA, every thing is ok.
>
> If <PATHFILE> is in Shared Directory of clientB, such as
> \\clientB\SharedDocs\routine.dll, the following message appeared:
>
> CREATE ASSEMBLY failed because it could not open the physical file
> '\\clientB\SharedDocs\routine.dll': 5(access denied).
>
> How to fix it ? Thanks.
>
> Ajang
>
>
>
Author
7 Apr 2006 8:10 AM
ML
The other posters are referring to the start-up service account for the SQL
Server service. Go to Services and make sure the account in which the service
runs has sufficient privileges on the destination path.


ML

---
http://milambda.blogspot.com/
Author
13 Apr 2006 9:47 AM
AJang
Using SQL Server Management Studio, I can't create assembly as I mention above.

In the same configuration, using sqlcmd, I DO create assembly successfully.

So, may be it is a BUG of SQL Server Management Studio ?
By the way, my Microsoft SQL Server Management Studio's version is
9.00.1399.00

HJY

Show quoteHide quote
"ML" wrote:

> The other posters are referring to the start-up service account for the SQL
> Server service. Go to Services and make sure the account in which the service
> runs has sufficient privileges on the destination path.
>
>
> ML
>
> ---
> http://milambda.blogspot.com/
Author
13 Apr 2006 11:53 AM
Niels Berglund
=?Utf-8?B?QUphbmc=?= <AJ***@discussions.microsoft.com> wrote in
news:94B69361-59F2-4F99-91B0-1B6918CE8CC6@microsoft.com:

> Using SQL Server Management Studio, I can't create assembly as I
> mention above.
>
> In the same configuration, using sqlcmd, I DO create assembly
> successfully.
>
> So, may be it is a BUG of SQL Server Management Studio ?
> By the way, my Microsoft SQL Server Management Studio's version is
> 9.00.1399.00

Are you by any chance logging on to the SQL Server in SSMS by using SQL
Server security, and not Windows integrated?

Also, are you absolutely sure the path is exactly the same when you do
it in SSMS compared to SqlCmd?

Niels

--
**************************************************
* Niels Berglund
* http://staff.develop.com/nielsb
* nielsb at develop dot com
* "A First Look at SQL Server 2005 for Developers"
* http://www.awprofessional.com/title/0321180593
**************************************************
Author
13 Apr 2006 3:45 PM
AJang
Show quote Hide quote
"Niels Berglund" wrote:

> =?Utf-8?B?QUphbmc=?= <AJ***@discussions.microsoft.com> wrote in
> news:94B69361-59F2-4F99-91B0-1B6918CE8CC6@microsoft.com:
>
> > Using SQL Server Management Studio, I can't create assembly as I
> > mention above.
> >
> > In the same configuration, using sqlcmd, I DO create assembly
> > successfully.
> >
> > So, may be it is a BUG of SQL Server Management Studio ?
> > By the way, my Microsoft SQL Server Management Studio's version is
> > 9.00.1399.00
>
> Are you by any chance logging on to the SQL Server in SSMS by using SQL
> Server security, and not Windows integrated?

The Sql server instance is in pure Windows integrated authenticate mode.

>
> Also, are you absolutely sure the path is exactly the same when you do
> it in SSMS compared to SqlCmd?

Yes, I use Copy/Paste strategy to ensure identically the same SQL script.

Show quoteHide quote
>
> Niels
>
> --
> **************************************************
> * Niels Berglund
> * http://staff.develop.com/nielsb
> * nielsb at develop dot com
> * "A First Look at SQL Server 2005 for Developers"
> * http://www.awprofessional.com/title/0321180593
> **************************************************
>
Author
13 Apr 2006 4:32 PM
Niels Berglund
=?Utf-8?B?QUphbmc=?= <AJ***@discussions.microsoft.com> wrote in
news:DDABC7CD-B60F-4220-B322-1625C32265B0@microsoft.com:

> The Sql server instance is in pure Windows integrated authenticate
> mode.

And the login which you use for SSMS has access to the path where the
dll is located?
>
>>
>> Also, are you absolutely sure the path is exactly the same when you
>> do it in SSMS compared to SqlCmd?
>
> Yes, I use Copy/Paste strategy to ensure identically the same SQL
> script.

Can you please post the statement that gives you the error from SSMS.
Please post it exactly as you you have it in SSMS.

Niels


--
**************************************************
* Niels Berglund
* http://staff.develop.com/nielsb
* nielsb at develop dot com
* "A First Look at SQL Server 2005 for Developers"
* http://www.awprofessional.com/title/0321180593
**************************************************
Author
14 Apr 2006 7:49 AM
AJang
Show quote Hide quote
"Niels Berglund" wrote:

> =?Utf-8?B?QUphbmc=?= <AJ***@discussions.microsoft.com> wrote in
> news:DDABC7CD-B60F-4220-B322-1625C32265B0@microsoft.com:
>
> > The Sql server instance is in pure Windows integrated authenticate
> > mode.
>
> And the login which you use for SSMS has access to the path where the
> dll is located?
> >
> >>
> >> Also, are you absolutely sure the path is exactly the same when you
> >> do it in SSMS compared to SqlCmd?
> >
> > Yes, I use Copy/Paste strategy to ensure identically the same SQL
> > script.
>
> Can you please post the statement that gives you the error from SSMS.
> Please post it exactly as you you have it in SSMS.

Thanks a lot.
After looking through all the detail, I found that
1. In SSMS , I connect to <IP address>\sqlexpress
2. In Sqlcmd, I connect to <NetBiosName>\sqlexpress
So, I know it IS an access right problem.

Now, can you tell me
1. In connecting to <IP address>\sqlexpress case, Sql server impersonate as
which account to access an UNC path file.

2. In connecting to <NetBiosName>\sqlexpress case, Sql server impersonate as
which account to access an UNC path file.

HJY

Show quoteHide quote
>
> Niels
>
>
> --
> **************************************************
> * Niels Berglund
> * http://staff.develop.com/nielsb
> * nielsb at develop dot com
> * "A First Look at SQL Server 2005 for Developers"
> * http://www.awprofessional.com/title/0321180593
> **************************************************
>
Author
7 Apr 2006 11:32 AM
Niels Berglund
=?Utf-8?B?QUphbmc=?= <AJ***@discussions.microsoft.com> wrote in
news:54E4FCEB-B9CC-4DB0-8438-0333C0A77F4E@microsoft.com:

> In fact, ServerA is a domain controller of domain TEST,ClientB is a
> member machine of TEST.
>
[snip]

> The error message are the same.
> How to solve the access right problem?

Create the assembly from a byte stream instead.

Niels

--
**************************************************
* Niels Berglund
* http://staff.develop.com/nielsb
* nielsb at develop dot com
* "A First Look at SQL Server 2005 for Developers"
* http://www.awprofessional.com/title/0321180593
**************************************************

Bookmark and Share