powered by simpleCommunicator - 2.0.60     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / Microsoft SQL Server [игнор отключен] [закрыт для гостей] / BULK INSERT - error code 5(Access is denied.)
11 сообщений из 11, страница 1 из 1
BULK INSERT - error code 5(Access is denied.)
    #36400247
usausa
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
BULK INSERT unitconv FROM '\\xx.xx.xx.xx\uc\UCTEST.txt'


виполнаю команду, при етом все аккаунти(пользователа и сервиса) имеют доступ к папке другого компьютера + имеют сусадмин права, но видает ошибку. Поиск по форуму и в инете не помог, может у кого есть идеи?


4861, Level 16, State 1, Line 1
Cannot bulk load because the file "\\хх.хх.хх.хх\uc\UCTEST.txt" could not be opened. Operating system error code 5(Access is denied.).


select @@version
Microsoft SQL Server 2008 (SP1) - 10.0.2531.0 (X64) Mar 29 2009 10:11:52 Copyright (c) 1988-2008 Microsoft Corporation Enterprise Edition (64-bit) on Windows NT 6.0 <X64> (Build 6001: Service Pack 1) (VM)
...
Рейтинг: 0 / 0
BULK INSERT - error code 5(Access is denied.)
    #36400272
usausa
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
usausa,

for 2005, but I have 2008

----
http://maykov.blogspot.com/2009/02/bulk-insert-access-denied-problem.html

bulk insert access denied problem

You may get this error when trying to use the bulk insert operator in SQL server 2005:

Cannot bulk load because the file "\\maykov100\public\blogcatalog.txt" could not be opened. Operating system error code 5(Access is denied.).

As it turns out, SQL server tries to use your credential to access the file to bulk import (impersonation). In a situation, where you access SQL server remotely (ie from a SQL Management Studio running on your machine), your credentials can't be retranslated. Possible ways to solve this problem:

* Use BCP from your local machine
* Run the SQL managements studio directly on a SQL machine
* Modify your company's active directory to allow impresonalizati0n

----
...
Рейтинг: 0 / 0
BULK INSERT - error code 5(Access is denied.)
    #36400315
Фёдоров
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
usausausausa,

for 2005, but I have 2008

----
http://maykov.blogspot.com/2009/02/bulk-insert-access-denied-problem.html

bulk insert access denied problem

You may get this error when trying to use the bulk insert operator in SQL server 2005:

Cannot bulk load because the file "\\maykov100\public\blogcatalog.txt" could not be opened. Operating system error code 5(Access is denied.).

As it turns out, SQL server tries to use your credential to access the file to bulk import (impersonation). In a situation, where you access SQL server remotely (ie from a SQL Management Studio running on your machine), your credentials can't be retranslated. Possible ways to solve this problem:

* Use BCP from your local machine
* Run the SQL managements studio directly on a SQL machine
* Modify your company's active directory to allow impresonalizati0n

----

Ну, дык пробовали

автор* Run the SQL managements studio directly on a SQL machine ?

В качестве быстрого решения проблемы могу посоветовать скопировать файл на сервер и уже потом выполнить команду bulk insert
...
Рейтинг: 0 / 0
BULK INSERT - error code 5(Access is denied.)
    #36400321
usausa
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
нельза, ето надо дла девелопера, которий делает SSIS пакет, временное решение не имеет смисла.
Девелопер работает конечно же не на стороне SQL Servera(not directly)
...
Рейтинг: 0 / 0
BULK INSERT - error code 5(Access is denied.)
    #36400330
Glory
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
usausaнельза, ето надо дла девелопера, которий делает SSIS пакет, временное решение не имеет смисла.
Девелопер работает конечно же не на стороне SQL Servera(not directly)
Читать нужно оригинальный хелп прежде всего

Статья Importing Bulk Data by Using BULK INSERT or OPENROWSET(BULK...)
...
Рейтинг: 0 / 0
BULK INSERT - error code 5(Access is denied.)
    #36400934
usausa
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Глория, процитал Блоб, но ничего нового не увидел, не могли би ви мена ткнуть носом, где рить дальше..вот кусок из документации:

++++++++++++++++++++++++++++++++++++++++++++
Security Considerations

If a user uses a SQL Server login, the security profile of the SQL Server process account is used. In contrast, if a SQL Server user logs on by using Windows Authentication, the user can read only those files that can be accessed by the user account, regardless of the security profile of the SQL Server process.

For example, consider a user who logged in to an instance of SQL Server by using Windows Authentication. For the user to be able to use BULK INSERT or OPENROWSET to import data from a data file into a SQL Server table, the user account requires read access to the data file. With access to the data file, the user can import data from the file into a table even if the SQL Server process does not have permission to access the file. The user does not have to grant file-access permission to the SQL Server process.

SQL Server and Microsoft Windows can be configured to enable an instance of SQL Server to connect to another instance of SQL Server by forwarding the credentials of an authenticated Windows user. This arrangement is known as impersonation or delegation. Understanding how SQL Server 2005 and later versions handle security for user impersonation is important when you use BULK INSERT or OPENROWSET. User impersonation allows the data file to reside on a different computer than either the SQL Server process or the user. For example, if a user on Computer_A has access to a data file on Computer_B, and the delegation of credentials has been set appropriately, the user can connect to an instance of SQL Server that is running on Computer_C, access the data file on Computer_B, and bulk import data from that file into a table on Computer_C. For more information, see Understanding Impersonation.
ms175915.note(en-us,SQL.100).gifNote:
The way in which SQL Server 2005 and later versions control access to files addresses a security issue that was present in Microsoft SQL Server 2000 and earlier versions. Formerly, after a user was authenticated, access to external files was based on the security profile of the SQL Server process. When the SQL Server process had read access to a file, for a user that did not have access to the file but was a member of the bulkadmin fixed server role, the user could import the file by using BULK INSERT and access the contents of the file.

Bulk Importing from a Remote Data File

To use BULK INSERT or INSERT...SELECT * FROM OPENROWSET(BULK...) to bulk import data from another computer, the data file must be shared between the two computers. To specify a shared data file, use its universal naming convention (UNC) name, which takes the general form, \\Servername\Sharename\Path\Filename. Additionally, the account used to access the data file must have the permissions that are required for reading the file on the remote disk.


For example, the following BULK INSERT statement bulk imports data into the SalesOrderDetail table of the AdventureWorks database from a data file that is named newdata.txt. This data file resides in a shared folder named \dailyorders on a network share directory named salesforce on a system named computer2.

BULK INSERT AdventureWorks.Sales.SalesOrderDetail
FROM '\\computer2\salesforce\dailyorders\neworders.txt';
GO
...
Рейтинг: 0 / 0
Период между сообщениями больше года.
BULK INSERT - error code 5(Access is denied.)
    #39798857
RESEARCH
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Коллеги имею точно такую же ошибку

Cannot bulk load because the file "\\RIGLA-0095\tmp\data1.csv" could not be opened. Operating system error code 5(Access is denied.).

скажите по русски что надо сделать ?
...
Рейтинг: 0 / 0
BULK INSERT - error code 5(Access is denied.)
    #39798865
aleks222
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
RESEARCHКоллеги имею точно такую же ошибку

Cannot bulk load because the file "\\RIGLA-0095\tmp\data1.csv" could not be opened. Operating system error code 5(Access is denied.).

скажите по русски что надо сделать ?
Учиться надо.
...
Рейтинг: 0 / 0
BULK INSERT - error code 5(Access is denied.)
    #39799155
RESEARCH
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Коллеги и все же я не понимаю

прописал на папку доступ от mssqlserver и loginuser и тот же результат.
...
Рейтинг: 0 / 0
BULK INSERT - error code 5(Access is denied.)
    #39799157
aleks222
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
RESEARCHКоллеги и все же я не понимаю

прописал на папку доступ от mssqlserver и loginuser и тот же результат.

Что-то мой хрустальный шар треснул - нихера не видно, чего ты там "прописал".

1. Зайди на сервер под учеткой MS SQL - проверь наличие доступа.
...
Рейтинг: 0 / 0
BULK INSERT - error code 5(Access is denied.)
    #39799160
Фотография alexeyvg
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
RESEARCHпрописал на папку доступ от mssqlserver и loginuser и тот же результат.А что такое "доступ от mssqlserver"?

loginuser - это имеется в виду Windows-пользователь?
Когда под ним логинитесь в виндах на сервере, видите этот файл "\\RIGLA-0095\tmp\data1.csv"?
...
Рейтинг: 0 / 0
11 сообщений из 11, страница 1 из 1
Форумы / Microsoft SQL Server [игнор отключен] [закрыт для гостей] / BULK INSERT - error code 5(Access is denied.)
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]