Re: Cannot perform BULK INSERT even though the account is a bulkadmin

From: Jasper Smith (jasper_smith9@hotmail.com)
Date: 03/03/03


From: "Jasper Smith" <jasper_smith9@hotmail.com>
Date: Mon, 3 Mar 2003 22:03:15 -0000


It seems that you require at least insert permissions plus
ddl_admin or db_owner to bulk insert into a table you
don't own when you are a non sysadmin using dynamic sql
When you use dynamic sql, all object permissions are checked
for the user running the command. Thus you need insert rights
to put the data in the table plus the fact you don't own the table
means you need to be ddl_admin or db_owner because the
BULK INSERT command seems to be setting some SET option
that requires a permission on the table that only those two roles
can give you. You really don't want to give those rights to joe user
though. This doesn't actually seem related to dynamic sql. Even
using hard coded values in a procedure causes this error.

-- 
HTH
Jasper Smith (SQL Server MVP)
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Duck Dunn" <x@outerinternet.com> wrote in message
news:3e63b159$1@news.microsoft.com...
> We have a stored procedure that dynamically constructs a BULK INSERT
> statement string and executes it. The account that executes this stored
> procedure is not the DB owner or table owner, but has been given "Bulk
> Insert Administrator" server role.
>
> We get the following error while executing this stored procedure:
>
> The current user is not the database or object owner of table
> 'PreStageOrganization_AATP'. Cannot perform SET operation.
>
> Pl let us know what permissions are missing for this operation.
>
> Thanks
>
>


Relevant Pages

  • Re: broken ownership chains
    ... only EXEC permissions on the stored procedure, ... on all the database objects referenced within the dynamic SQL. ... > insert into OnlyNumbers values ...
    (microsoft.public.sqlserver.security)
  • Re: SP accessing other db
    ... > so dynamic SQL always breaks the ownership chain. ... > The larger issue is why you need to use multiple databases. ... > chain security so that permissions on indirectly referenced objects are ...
    (microsoft.public.sqlserver.security)
  • Re: sqlBulkCopy and required permissions
    ... I believe the same permissions are needed for SqlBulkCopy as BULK INSERT. ... SQL Server MVP ...
    (microsoft.public.sqlserver.security)
  • Re: Bulk Insert Error
    ... BULK INSERT does support UNC file access across the network. ... that the SQL Server service account has permissions to access the share? ... > This <ServerName> is not the servername of the SQL Box, ...
    (microsoft.public.sqlserver.dts)
  • Re: Sql Security ?QL
    ... Permissions on indirectly referenced objects are not checked as long as the ... Permissions to use the statementwithin the EXECUTE string are checked at ... See http://www.sommarskog.se/dynamic_sql.html for other dynamic SQL ...
    (microsoft.public.sqlserver.security)