Re: ADO.net, asp.net & Bulk Copy



Members of the bulkadmin role are allowed to execute the BULK INSERT
statement. So you need to add the user to the Fixed server role.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adminsql/ad_security_6ndx.asp

HTH

Elton Wang



"Francis" wrote:

> Hi,
> Thanks for the reply. Just trying that out now, but getting the error:
> "You do not have permission to use the BULK INSERT statement" although I
> am setup as db_owner.
> Thanks for your help.
>
>
> Elton W wrote:
> >> 1. Is there a way of uploading a file to the sql
> >
> > server from another PC?
> >
> > Yes. You can use bulk insert text file to Db:
> >
> > command.CommandText = "BULK INSERT db_table_name
> > FROM 'filepath\filename' WITH
> > (DATAFILETYPE = 'char', FIELDTERMINATOR = ',',
> > ROWTERMINATOR = '\n')"
> > command.ExecuteNonQuery()
> >
> >
> >> 2. Is it possible to manipulate the data before
> >
> > bulk inserting?
> > Yes. But you need read data to datatable first.
> >
> >
> >> 3. Is it possible to just bulk insert the data
> >
> > from a Data Table/ Data Set?
> > In ADO.NET 2.0, SqlBulkCopy can write dataset to db
> > directly. In ADO.NET 1.X, you need implement your code.
> > Look at following URL
> > http://support.microsoft.com/kb/315968/EN-US/
> >
> > HTH
> >
> > Elton Wang
> > elton_wang@xxxxxxxxxxx
> >
> >
> >
> >>
> >> Thank you
> >> Francis
> >>.
> >>
>
.



Relevant Pages

  • Re: Least role permission
    ... TRUNCATE TABLE permissions default to the table owner, ... sysadmin fixed server role, and the db_owner and db_ddladmin fixed database ... BULK INSERT ... Therefore, for Truncate Table, db_ddladmin is the least rights needed. ...
    (microsoft.public.sqlserver.security)
  • Re: Least role permission
    ... sysadmin fixed server role, and the db_owner and db_ddladmin fixed ... BULK INSERT ... Therefore, for Truncate Table, db_ddladmin is the least rights needed. ...
    (microsoft.public.sqlserver.security)
  • Re: ADO.net, asp.net & Bulk Copy
    ... but getting the error: "You do not have permission to use the BULK INSERT statement" although I am setup as db_owner. ... SqlBulkCopy can write dataset to db directly. ... Elton Wang ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Bulk Insert Via SQLCommand?
    ... > Did you run it in Web or Windows application? ... > Elton Wang ... I am trying to bulk insert a text file into SQL ...
    (microsoft.public.dotnet.framework.adonet)