364,111 Members | 2068 Browsing Online
Community for Developers & IT Professionals
Bytes IT Community

Bulkadmin role (BULK INSERT)

php newbie
P: n/a
php newbie
Hello,

I am trying to load a simple tab-delimited data file to SQL Server. I
created a format file to go with it, since the data file differs from
the destination table in number of columns.

When I execute the query, I get an error saying that only sysadmin or
bulkadmin roles are allowed to use the BULK INSERT statement. So, I
proceeded with the Enterprise Manager to grant myself those roles.
However, I could not find sysadmin or bulkadmin roles using the
Enterprise Manager. From what I read from my books, I thought these
were fixed server roles and that they would be there.

So I have a few questions:
1) How do I create a user account/role that can issue BULK INSERT
commands?

2) Why is BULK INSERT considered a dangerous operation that it
requires special privileges? What are its implications? I have a
couple of books that say that a user should be aware of its
implications before using it, but they don't actually describe what
those implications might be.

3) It seems that I can load the data file using BCP utility, without
such privileges. If so, what is the difference?

Thanks!
Jul 20 '05
Share this Question
Share on Google+
2 Replies


Dan Guzman
P: n/a
Dan Guzman
> So, I proceeded with the Enterprise Manager to grant myself those[color=blue]
> roles. However, I could not find sysadmin or bulkadmin roles using the
> Enterprise Manager. From what I read from my books, I thought these
> were fixed server roles and that they would be there.
>
> So I have a few questions:
> 1) How do I create a user account/role that can issue BULK INSERT
> commands?[/color]

The roles are there but you need to be a sysadmin role member or a member of
that fixed server role in order to add members. Ask your DBA to do this.
[color=blue]
> 2) Why is BULK INSERT considered a dangerous operation that it
> requires special privileges? What are its implications? I have a
> couple of books that say that a user should be aware of its
> implications before using it, but they don't actually describe what
> those implications might be.[/color]

The main security implication is that BULK INSERT accesses external data
under the security context of the SQL Server service account rather than the
invoking user's account.
[color=blue]
> 3) It seems that I can load the data file using BCP utility, without
> such privileges. If so, what is the difference?[/color]

Client-based bulk insert techniques like SQLOLEDB IRowsetFastLoad and ODBC
BCP access data under the security context of the invoking user.

--
Hope this helps.

Dan Guzman
SQL Server MVP

"php newbie" <newtophp2000@yahoo.com> wrote in message
news:124f428e.0406052020.16b6b4e6@posting.google.c om...[color=blue]
> Hello,
>
> I am trying to load a simple tab-delimited data file to SQL Server. I
> created a format file to go with it, since the data file differs from
> the destination table in number of columns.
>
> When I execute the query, I get an error saying that only sysadmin or
> bulkadmin roles are allowed to use the BULK INSERT statement. So, I
> proceeded with the Enterprise Manager to grant myself those roles.
> However, I could not find sysadmin or bulkadmin roles using the
> Enterprise Manager. From what I read from my books, I thought these
> were fixed server roles and that they would be there.
>
> So I have a few questions:
> 1) How do I create a user account/role that can issue BULK INSERT
> commands?
>
> 2) Why is BULK INSERT considered a dangerous operation that it
> requires special privileges? What are its implications? I have a
> couple of books that say that a user should be aware of its
> implications before using it, but they don't actually describe what
> those implications might be.
>
> 3) It seems that I can load the data file using BCP utility, without
> such privileges. If so, what is the difference?
>
> Thanks![/color]


Jul 20 '05

php newbie
P: n/a
php newbie
"Dan Guzman" <danguzman@nospam-earthlink.net> wrote in message news:<bRGwc.3644$uX2.3489@newsread2.news.pas.earth link.net>...[color=blue][color=green]
> > So, I proceeded with the Enterprise Manager to grant myself those
> > roles. However, I could not find sysadmin or bulkadmin roles using the
> > Enterprise Manager. From what I read from my books, I thought these
> > were fixed server roles and that they would be there.
> >
> > So I have a few questions:
> > 1) How do I create a user account/role that can issue BULK INSERT
> > commands?[/color]
>
> The roles are there but you need to be a sysadmin role member or a member of
> that fixed server role in order to add members. Ask your DBA to do this.[/color]

Hello Dan,

This was for personal use, so that makes me the DBA. I believe I
disabled the "sa" account when I first installed SQL Server (based on
some suggestions due to security risks). Perhaps that has something
to do with it. I will look into it.

[color=blue]
> Client-based bulk insert techniques like SQLOLEDB IRowsetFastLoad and ODBC
> BCP access data under the security context of the invoking user.[/color]

Thanks! This clarifies the risk implications of BULK INSERT vs. bcp
that was not in the books. It looks like Bcp is the sure way to go
for most users.

[color=blue]
> --
> Hope this helps.
>
> Dan Guzman
> SQL Server MVP[/color]
Jul 20 '05

Post your reply

Help answer this question



Didn't find the answer to your Microsoft SQL Server question?

You can also browse similar questions: Microsoft SQL Server bulkadmin