Sunday, March 11, 2012
Bulk Insert for non admins
instance of SQL on my desktop. I create an SQL Login named BITest and allow
him into my Pubs DB. I then add him to the BulkAdmin fixed server role. When
I have him try to Bulk Insert, I get:
Server: Msg 8104, Level 16, State 2, Line 1
The current user is not the database or object owner of table
'pubs.dbo.t_access'. Cannot perform SET operation.
Which sort of indicates he needs to be in the db_owner role? Even though I
think thats crap, I add him to db_owner, and then try to run my Bulk Insert
again. This time I get:
Server: Msg 4834, Level 16, State 1, Line 1
You do not have permission to use the BULK INSERT statement.
So, not only does it really appear that he nees to be part of db_owner, it
still doesnt work. What gives?
TIA,
ChrisR
Chris,
From BOL:
Permissions
Only members of the sysadmin and bulkadmin fixed server roles can execute
BULK INSERT.
HTH
Jerry
"ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
news:8A4D0077-8989-4CA0-90AD-98EE96C9CEB8@.microsoft.com...
> Since Im pretty sure BCP is out, Ill look into Bulk Insert. I have a local
> instance of SQL on my desktop. I create an SQL Login named BITest and
> allow
> him into my Pubs DB. I then add him to the BulkAdmin fixed server role.
> When
> I have him try to Bulk Insert, I get:
> Server: Msg 8104, Level 16, State 2, Line 1
> The current user is not the database or object owner of table
> 'pubs.dbo.t_access'. Cannot perform SET operation.
> Which sort of indicates he needs to be in the db_owner role? Even though
> I
> think thats crap, I add him to db_owner, and then try to run my Bulk
> Insert
> again. This time I get:
> Server: Msg 4834, Level 16, State 1, Line 1
> You do not have permission to use the BULK INSERT statement.
> So, not only does it really appear that he nees to be part of db_owner, it
> still doesnt work. What gives?
> --
> TIA,
> ChrisR
|||Jerry, as indicated in my post, I added him to that role.
TIA,
ChrisR
"Jerry Spivey" wrote:
> Chris,
> From BOL:
> Permissions
> Only members of the sysadmin and bulkadmin fixed server roles can execute
> BULK INSERT.
> HTH
> Jerry
> "ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
> news:8A4D0077-8989-4CA0-90AD-98EE96C9CEB8@.microsoft.com...
>
>
|||Chris,
I got it to work with BULKADMIN and DB_OWNER. How many records to you have?
Do you really need to use BCP/BULK INSERT or would DTS possibly work?
HTH
Jerry
"ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
news:1B350D2E-A85B-4E25-B3C9-C19620DF0ACF@.microsoft.com...[vbcol=seagreen]
> Jerry, as indicated in my post, I added him to that role.
> --
> TIA,
> ChrisR
>
> "Jerry Spivey" wrote:
|||I have 48 reconds. DTS may work, but I'd really like to try to get this
going. You're user is NOT a member of either SA of Admins, right?
TIA,
ChrisR
"Jerry Spivey" wrote:
> Chris,
> I got it to work with BULKADMIN and DB_OWNER. How many records to you have?
> Do you really need to use BCP/BULK INSERT or would DTS possibly work?
> HTH
> Jerry
> "ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
> news:1B350D2E-A85B-4E25-B3C9-C19620DF0ACF@.microsoft.com...
>
>
|||I'd recommend DTS but it is your choice. No...created new login and user to
test for your example.
HTH
Jerry
"ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
news:63A4B6D4-EABD-409A-BD49-E39B0CC7FF6F@.microsoft.com...[vbcol=seagreen]
>I have 48 reconds. DTS may work, but I'd really like to try to get this
> going. You're user is NOT a member of either SA of Admins, right?
> --
> TIA,
> ChrisR
>
> "Jerry Spivey" wrote:
|||Curious, why DTS? Also, Im running SQL2K, and you?
TIA,
ChrisR
"Jerry Spivey" wrote:
> I'd recommend DTS but it is your choice. No...created new login and user to
> test for your example.
> HTH
> Jerry
> "ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
> news:63A4B6D4-EABD-409A-BD49-E39B0CC7FF6F@.microsoft.com...
>
>
|||Its fast, friendly (permissions issue in your case) and more functional.
SQL 2000 as well.
HTH
Jerry
"ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
news:B4925F9E-6BBB-477E-B4B7-9817D10CB89B@.microsoft.com...[vbcol=seagreen]
> Curious, why DTS? Also, Im running SQL2K, and you?
> --
> TIA,
> ChrisR
>
> "Jerry Spivey" wrote:
Thursday, March 8, 2012
Bulk Insert for non admins
instance of SQL on my desktop. I create an SQL Login named BITest and allow
him into my Pubs DB. I then add him to the BulkAdmin fixed server role. Whe
n
I have him try to Bulk Insert, I get:
Server: Msg 8104, Level 16, State 2, Line 1
The current user is not the database or object owner of table
'pubs.dbo.t_access'. Cannot perform SET operation.
Which sort of indicates he needs to be in the db_owner role? Even though I
think thats crap, I add him to db_owner, and then try to run my Bulk Insert
again. This time I get:
Server: Msg 4834, Level 16, State 1, Line 1
You do not have permission to use the BULK INSERT statement.
So, not only does it really appear that he nees to be part of db_owner, it
still doesnt work. What gives?
TIA,
ChrisRChris,
From BOL:
Permissions
Only members of the sysadmin and bulkadmin fixed server roles can execute
BULK INSERT.
HTH
Jerry
"ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
news:8A4D0077-8989-4CA0-90AD-98EE96C9CEB8@.microsoft.com...
> Since Im pretty sure BCP is out, Ill look into Bulk Insert. I have a local
> instance of SQL on my desktop. I create an SQL Login named BITest and
> allow
> him into my Pubs DB. I then add him to the BulkAdmin fixed server role.
> When
> I have him try to Bulk Insert, I get:
> Server: Msg 8104, Level 16, State 2, Line 1
> The current user is not the database or object owner of table
> 'pubs.dbo.t_access'. Cannot perform SET operation.
> Which sort of indicates he needs to be in the db_owner role? Even though
> I
> think thats crap, I add him to db_owner, and then try to run my Bulk
> Insert
> again. This time I get:
> Server: Msg 4834, Level 16, State 1, Line 1
> You do not have permission to use the BULK INSERT statement.
> So, not only does it really appear that he nees to be part of db_owner, it
> still doesnt work. What gives?
> --
> TIA,
> ChrisR|||Jerry, as indicated in my post, I added him to that role.
--
TIA,
ChrisR
"Jerry Spivey" wrote:
> Chris,
> From BOL:
> Permissions
> Only members of the sysadmin and bulkadmin fixed server roles can execute
> BULK INSERT.
> HTH
> Jerry
> "ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
> news:8A4D0077-8989-4CA0-90AD-98EE96C9CEB8@.microsoft.com...
>
>|||Chris,
I got it to work with BULKADMIN and DB_OWNER. How many records to you have?
Do you really need to use BCP/BULK INSERT or would DTS possibly work?
HTH
Jerry
"ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
news:1B350D2E-A85B-4E25-B3C9-C19620DF0ACF@.microsoft.com...[vbcol=seagreen]
> Jerry, as indicated in my post, I added him to that role.
> --
> TIA,
> ChrisR
>
> "Jerry Spivey" wrote:
>|||I have 48 reconds. DTS may work, but I'd really like to try to get this
going. You're user is NOT a member of either SA of Admins, right?
--
TIA,
ChrisR
"Jerry Spivey" wrote:
> Chris,
> I got it to work with BULKADMIN and DB_OWNER. How many records to you hav
e?
> Do you really need to use BCP/BULK INSERT or would DTS possibly work?
> HTH
> Jerry
> "ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
> news:1B350D2E-A85B-4E25-B3C9-C19620DF0ACF@.microsoft.com...
>
>|||I'd recommend DTS but it is your choice. No...created new login and user to
test for your example.
HTH
Jerry
"ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
news:63A4B6D4-EABD-409A-BD49-E39B0CC7FF6F@.microsoft.com...[vbcol=seagreen]
>I have 48 reconds. DTS may work, but I'd really like to try to get this
> going. You're user is NOT a member of either SA of Admins, right?
> --
> TIA,
> ChrisR
>
> "Jerry Spivey" wrote:
>|||Curious, why DTS? Also, Im running SQL2K, and you?
--
TIA,
ChrisR
"Jerry Spivey" wrote:
> I'd recommend DTS but it is your choice. No...created new login and user
to
> test for your example.
> HTH
> Jerry
> "ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
> news:63A4B6D4-EABD-409A-BD49-E39B0CC7FF6F@.microsoft.com...
>
>|||Its fast, friendly (permissions issue in your case) and more functional.
SQL 2000 as well.
HTH
Jerry
"ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
news:B4925F9E-6BBB-477E-B4B7-9817D10CB89B@.microsoft.com...[vbcol=seagreen]
> Curious, why DTS? Also, Im running SQL2K, and you?
> --
> TIA,
> ChrisR
>
> "Jerry Spivey" wrote:
>
Bulk Insert for non admins
instance of SQL on my desktop. I create an SQL Login named BITest and allow
him into my Pubs DB. I then add him to the BulkAdmin fixed server role. When
I have him try to Bulk Insert, I get:
Server: Msg 8104, Level 16, State 2, Line 1
The current user is not the database or object owner of table
'pubs.dbo.t_access'. Cannot perform SET operation.
Which sort of indicates he needs to be in the db_owner role? Even though I
think thats crap, I add him to db_owner, and then try to run my Bulk Insert
again. This time I get:
Server: Msg 4834, Level 16, State 1, Line 1
You do not have permission to use the BULK INSERT statement.
So, not only does it really appear that he nees to be part of db_owner, it
still doesnt work. What gives?
--
TIA,
ChrisRChris,
From BOL:
Permissions
Only members of the sysadmin and bulkadmin fixed server roles can execute
BULK INSERT.
HTH
Jerry
"ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
news:8A4D0077-8989-4CA0-90AD-98EE96C9CEB8@.microsoft.com...
> Since Im pretty sure BCP is out, Ill look into Bulk Insert. I have a local
> instance of SQL on my desktop. I create an SQL Login named BITest and
> allow
> him into my Pubs DB. I then add him to the BulkAdmin fixed server role.
> When
> I have him try to Bulk Insert, I get:
> Server: Msg 8104, Level 16, State 2, Line 1
> The current user is not the database or object owner of table
> 'pubs.dbo.t_access'. Cannot perform SET operation.
> Which sort of indicates he needs to be in the db_owner role? Even though
> I
> think thats crap, I add him to db_owner, and then try to run my Bulk
> Insert
> again. This time I get:
> Server: Msg 4834, Level 16, State 1, Line 1
> You do not have permission to use the BULK INSERT statement.
> So, not only does it really appear that he nees to be part of db_owner, it
> still doesnt work. What gives?
> --
> TIA,
> ChrisR|||Jerry, as indicated in my post, I added him to that role.
--
TIA,
ChrisR
"Jerry Spivey" wrote:
> Chris,
> From BOL:
> Permissions
> Only members of the sysadmin and bulkadmin fixed server roles can execute
> BULK INSERT.
> HTH
> Jerry
> "ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
> news:8A4D0077-8989-4CA0-90AD-98EE96C9CEB8@.microsoft.com...
> > Since Im pretty sure BCP is out, Ill look into Bulk Insert. I have a local
> > instance of SQL on my desktop. I create an SQL Login named BITest and
> > allow
> > him into my Pubs DB. I then add him to the BulkAdmin fixed server role.
> > When
> > I have him try to Bulk Insert, I get:
> >
> > Server: Msg 8104, Level 16, State 2, Line 1
> > The current user is not the database or object owner of table
> > 'pubs.dbo.t_access'. Cannot perform SET operation.
> >
> > Which sort of indicates he needs to be in the db_owner role? Even though
> > I
> > think thats crap, I add him to db_owner, and then try to run my Bulk
> > Insert
> > again. This time I get:
> >
> > Server: Msg 4834, Level 16, State 1, Line 1
> > You do not have permission to use the BULK INSERT statement.
> >
> > So, not only does it really appear that he nees to be part of db_owner, it
> > still doesnt work. What gives?
> >
> > --
> > TIA,
> > ChrisR
>
>|||Chris,
I got it to work with BULKADMIN and DB_OWNER. How many records to you have?
Do you really need to use BCP/BULK INSERT or would DTS possibly work?
HTH
Jerry
"ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
news:1B350D2E-A85B-4E25-B3C9-C19620DF0ACF@.microsoft.com...
> Jerry, as indicated in my post, I added him to that role.
> --
> TIA,
> ChrisR
>
> "Jerry Spivey" wrote:
>> Chris,
>> From BOL:
>> Permissions
>> Only members of the sysadmin and bulkadmin fixed server roles can execute
>> BULK INSERT.
>> HTH
>> Jerry
>> "ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
>> news:8A4D0077-8989-4CA0-90AD-98EE96C9CEB8@.microsoft.com...
>> > Since Im pretty sure BCP is out, Ill look into Bulk Insert. I have a
>> > local
>> > instance of SQL on my desktop. I create an SQL Login named BITest and
>> > allow
>> > him into my Pubs DB. I then add him to the BulkAdmin fixed server
>> > role.
>> > When
>> > I have him try to Bulk Insert, I get:
>> >
>> > Server: Msg 8104, Level 16, State 2, Line 1
>> > The current user is not the database or object owner of table
>> > 'pubs.dbo.t_access'. Cannot perform SET operation.
>> >
>> > Which sort of indicates he needs to be in the db_owner role? Even
>> > though
>> > I
>> > think thats crap, I add him to db_owner, and then try to run my Bulk
>> > Insert
>> > again. This time I get:
>> >
>> > Server: Msg 4834, Level 16, State 1, Line 1
>> > You do not have permission to use the BULK INSERT statement.
>> >
>> > So, not only does it really appear that he nees to be part of db_owner,
>> > it
>> > still doesnt work. What gives?
>> >
>> > --
>> > TIA,
>> > ChrisR
>>|||I have 48 reconds. DTS may work, but I'd really like to try to get this
going. You're user is NOT a member of either SA of Admins, right?
--
TIA,
ChrisR
"Jerry Spivey" wrote:
> Chris,
> I got it to work with BULKADMIN and DB_OWNER. How many records to you have?
> Do you really need to use BCP/BULK INSERT or would DTS possibly work?
> HTH
> Jerry
> "ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
> news:1B350D2E-A85B-4E25-B3C9-C19620DF0ACF@.microsoft.com...
> > Jerry, as indicated in my post, I added him to that role.
> > --
> > TIA,
> > ChrisR
> >
> >
> > "Jerry Spivey" wrote:
> >
> >> Chris,
> >>
> >> From BOL:
> >>
> >> Permissions
> >> Only members of the sysadmin and bulkadmin fixed server roles can execute
> >> BULK INSERT.
> >>
> >> HTH
> >>
> >> Jerry
> >>
> >> "ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
> >> news:8A4D0077-8989-4CA0-90AD-98EE96C9CEB8@.microsoft.com...
> >> > Since Im pretty sure BCP is out, Ill look into Bulk Insert. I have a
> >> > local
> >> > instance of SQL on my desktop. I create an SQL Login named BITest and
> >> > allow
> >> > him into my Pubs DB. I then add him to the BulkAdmin fixed server
> >> > role.
> >> > When
> >> > I have him try to Bulk Insert, I get:
> >> >
> >> > Server: Msg 8104, Level 16, State 2, Line 1
> >> > The current user is not the database or object owner of table
> >> > 'pubs.dbo.t_access'. Cannot perform SET operation.
> >> >
> >> > Which sort of indicates he needs to be in the db_owner role? Even
> >> > though
> >> > I
> >> > think thats crap, I add him to db_owner, and then try to run my Bulk
> >> > Insert
> >> > again. This time I get:
> >> >
> >> > Server: Msg 4834, Level 16, State 1, Line 1
> >> > You do not have permission to use the BULK INSERT statement.
> >> >
> >> > So, not only does it really appear that he nees to be part of db_owner,
> >> > it
> >> > still doesnt work. What gives?
> >> >
> >> > --
> >> > TIA,
> >> > ChrisR
> >>
> >>
> >>
>
>|||I'd recommend DTS but it is your choice. No...created new login and user to
test for your example.
HTH
Jerry
"ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
news:63A4B6D4-EABD-409A-BD49-E39B0CC7FF6F@.microsoft.com...
>I have 48 reconds. DTS may work, but I'd really like to try to get this
> going. You're user is NOT a member of either SA of Admins, right?
> --
> TIA,
> ChrisR
>
> "Jerry Spivey" wrote:
>> Chris,
>> I got it to work with BULKADMIN and DB_OWNER. How many records to you
>> have?
>> Do you really need to use BCP/BULK INSERT or would DTS possibly work?
>> HTH
>> Jerry
>> "ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
>> news:1B350D2E-A85B-4E25-B3C9-C19620DF0ACF@.microsoft.com...
>> > Jerry, as indicated in my post, I added him to that role.
>> > --
>> > TIA,
>> > ChrisR
>> >
>> >
>> > "Jerry Spivey" wrote:
>> >
>> >> Chris,
>> >>
>> >> From BOL:
>> >>
>> >> Permissions
>> >> Only members of the sysadmin and bulkadmin fixed server roles can
>> >> execute
>> >> BULK INSERT.
>> >>
>> >> HTH
>> >>
>> >> Jerry
>> >>
>> >> "ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
>> >> news:8A4D0077-8989-4CA0-90AD-98EE96C9CEB8@.microsoft.com...
>> >> > Since Im pretty sure BCP is out, Ill look into Bulk Insert. I have a
>> >> > local
>> >> > instance of SQL on my desktop. I create an SQL Login named BITest
>> >> > and
>> >> > allow
>> >> > him into my Pubs DB. I then add him to the BulkAdmin fixed server
>> >> > role.
>> >> > When
>> >> > I have him try to Bulk Insert, I get:
>> >> >
>> >> > Server: Msg 8104, Level 16, State 2, Line 1
>> >> > The current user is not the database or object owner of table
>> >> > 'pubs.dbo.t_access'. Cannot perform SET operation.
>> >> >
>> >> > Which sort of indicates he needs to be in the db_owner role? Even
>> >> > though
>> >> > I
>> >> > think thats crap, I add him to db_owner, and then try to run my Bulk
>> >> > Insert
>> >> > again. This time I get:
>> >> >
>> >> > Server: Msg 4834, Level 16, State 1, Line 1
>> >> > You do not have permission to use the BULK INSERT statement.
>> >> >
>> >> > So, not only does it really appear that he nees to be part of
>> >> > db_owner,
>> >> > it
>> >> > still doesnt work. What gives?
>> >> >
>> >> > --
>> >> > TIA,
>> >> > ChrisR
>> >>
>> >>
>> >>
>>|||Curious, why DTS? Also, Im running SQL2K, and you?
--
TIA,
ChrisR
"Jerry Spivey" wrote:
> I'd recommend DTS but it is your choice. No...created new login and user to
> test for your example.
> HTH
> Jerry
> "ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
> news:63A4B6D4-EABD-409A-BD49-E39B0CC7FF6F@.microsoft.com...
> >I have 48 reconds. DTS may work, but I'd really like to try to get this
> > going. You're user is NOT a member of either SA of Admins, right?
> > --
> > TIA,
> > ChrisR
> >
> >
> > "Jerry Spivey" wrote:
> >
> >> Chris,
> >>
> >> I got it to work with BULKADMIN and DB_OWNER. How many records to you
> >> have?
> >> Do you really need to use BCP/BULK INSERT or would DTS possibly work?
> >>
> >> HTH
> >>
> >> Jerry
> >> "ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
> >> news:1B350D2E-A85B-4E25-B3C9-C19620DF0ACF@.microsoft.com...
> >> > Jerry, as indicated in my post, I added him to that role.
> >> > --
> >> > TIA,
> >> > ChrisR
> >> >
> >> >
> >> > "Jerry Spivey" wrote:
> >> >
> >> >> Chris,
> >> >>
> >> >> From BOL:
> >> >>
> >> >> Permissions
> >> >> Only members of the sysadmin and bulkadmin fixed server roles can
> >> >> execute
> >> >> BULK INSERT.
> >> >>
> >> >> HTH
> >> >>
> >> >> Jerry
> >> >>
> >> >> "ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
> >> >> news:8A4D0077-8989-4CA0-90AD-98EE96C9CEB8@.microsoft.com...
> >> >> > Since Im pretty sure BCP is out, Ill look into Bulk Insert. I have a
> >> >> > local
> >> >> > instance of SQL on my desktop. I create an SQL Login named BITest
> >> >> > and
> >> >> > allow
> >> >> > him into my Pubs DB. I then add him to the BulkAdmin fixed server
> >> >> > role.
> >> >> > When
> >> >> > I have him try to Bulk Insert, I get:
> >> >> >
> >> >> > Server: Msg 8104, Level 16, State 2, Line 1
> >> >> > The current user is not the database or object owner of table
> >> >> > 'pubs.dbo.t_access'. Cannot perform SET operation.
> >> >> >
> >> >> > Which sort of indicates he needs to be in the db_owner role? Even
> >> >> > though
> >> >> > I
> >> >> > think thats crap, I add him to db_owner, and then try to run my Bulk
> >> >> > Insert
> >> >> > again. This time I get:
> >> >> >
> >> >> > Server: Msg 4834, Level 16, State 1, Line 1
> >> >> > You do not have permission to use the BULK INSERT statement.
> >> >> >
> >> >> > So, not only does it really appear that he nees to be part of
> >> >> > db_owner,
> >> >> > it
> >> >> > still doesnt work. What gives?
> >> >> >
> >> >> > --
> >> >> > TIA,
> >> >> > ChrisR
> >> >>
> >> >>
> >> >>
> >>
> >>
> >>
>
>|||Its fast, friendly (permissions issue in your case) and more functional.
SQL 2000 as well.
HTH
Jerry
"ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
news:B4925F9E-6BBB-477E-B4B7-9817D10CB89B@.microsoft.com...
> Curious, why DTS? Also, Im running SQL2K, and you?
> --
> TIA,
> ChrisR
>
> "Jerry Spivey" wrote:
>> I'd recommend DTS but it is your choice. No...created new login and user
>> to
>> test for your example.
>> HTH
>> Jerry
>> "ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
>> news:63A4B6D4-EABD-409A-BD49-E39B0CC7FF6F@.microsoft.com...
>> >I have 48 reconds. DTS may work, but I'd really like to try to get this
>> > going. You're user is NOT a member of either SA of Admins, right?
>> > --
>> > TIA,
>> > ChrisR
>> >
>> >
>> > "Jerry Spivey" wrote:
>> >
>> >> Chris,
>> >>
>> >> I got it to work with BULKADMIN and DB_OWNER. How many records to you
>> >> have?
>> >> Do you really need to use BCP/BULK INSERT or would DTS possibly work?
>> >>
>> >> HTH
>> >>
>> >> Jerry
>> >> "ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
>> >> news:1B350D2E-A85B-4E25-B3C9-C19620DF0ACF@.microsoft.com...
>> >> > Jerry, as indicated in my post, I added him to that role.
>> >> > --
>> >> > TIA,
>> >> > ChrisR
>> >> >
>> >> >
>> >> > "Jerry Spivey" wrote:
>> >> >
>> >> >> Chris,
>> >> >>
>> >> >> From BOL:
>> >> >>
>> >> >> Permissions
>> >> >> Only members of the sysadmin and bulkadmin fixed server roles can
>> >> >> execute
>> >> >> BULK INSERT.
>> >> >>
>> >> >> HTH
>> >> >>
>> >> >> Jerry
>> >> >>
>> >> >> "ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
>> >> >> news:8A4D0077-8989-4CA0-90AD-98EE96C9CEB8@.microsoft.com...
>> >> >> > Since Im pretty sure BCP is out, Ill look into Bulk Insert. I
>> >> >> > have a
>> >> >> > local
>> >> >> > instance of SQL on my desktop. I create an SQL Login named BITest
>> >> >> > and
>> >> >> > allow
>> >> >> > him into my Pubs DB. I then add him to the BulkAdmin fixed
>> >> >> > server
>> >> >> > role.
>> >> >> > When
>> >> >> > I have him try to Bulk Insert, I get:
>> >> >> >
>> >> >> > Server: Msg 8104, Level 16, State 2, Line 1
>> >> >> > The current user is not the database or object owner of table
>> >> >> > 'pubs.dbo.t_access'. Cannot perform SET operation.
>> >> >> >
>> >> >> > Which sort of indicates he needs to be in the db_owner role?
>> >> >> > Even
>> >> >> > though
>> >> >> > I
>> >> >> > think thats crap, I add him to db_owner, and then try to run my
>> >> >> > Bulk
>> >> >> > Insert
>> >> >> > again. This time I get:
>> >> >> >
>> >> >> > Server: Msg 4834, Level 16, State 1, Line 1
>> >> >> > You do not have permission to use the BULK INSERT statement.
>> >> >> >
>> >> >> > So, not only does it really appear that he nees to be part of
>> >> >> > db_owner,
>> >> >> > it
>> >> >> > still doesnt work. What gives?
>> >> >> >
>> >> >> > --
>> >> >> > TIA,
>> >> >> > ChrisR
>> >> >>
>> >> >>
>> >> >>
>> >>
>> >>
>> >>
>>
Wednesday, March 7, 2012
BULK Insert big Problem!
Ive a little problem. I want to load my test.csv - file into a MS-SQL DB named EGN. Well, everythings well with this query:
sql = "BULK INSERT EGN FROM 'C:\inetpub\wwwroot\handy\crm\datenaufbereitung\te st.csv' With (KEEPIDENTITY,KEEPNULLS,MAXERRORS=0,FIELDTERMINATO R = ';',ROWTERMINATOR="&"'"&vbLf&"'"&") "
My only problem is, that i need the recordsets to be sorted. means: i need it in the same order as in the csv.-file.
my fields named:
Date, Minuten, Art, Daten, Destination, Nummer, Rufnummer, Gebuehr
all of them are varchar-fields...
hmmm..any idea?!?!
Thanks so much!
-arion--BULK INSERT ...
Add option ROWS_PER_BATCH=1
or if you can sort by columns in file
with option ORDER ( { column [ ASC | DESC ] } [ ,...n ] )
for more see BOL
Why do you need it?
If you SELECT from table, output seems to be sorted
by clustered index or insertion order, but you can
not be sure of this in MSSQLSERVER2K.
You must specify ORDER BY.
Thursday, February 16, 2012
Buld Data load import
HI
I have a table XYZ that needs to contain a million records as operational data.
XYZ has a column named SLOT_VALUE which has values 1,2,3....100,000
What is the easiset way to bulk load this information in the shortest possible time...
Insert scripts/ Batch program like if..while loop takes heck lot of time....
Hello,
If you mean that you just want to populate that table with incrementing values from 1 to 1MIL, then the easiest would be to execute something like
select top 1000000 identity(int,1,1) as Num
into TempNumTable
from syscolumns c1
cross join syscolumns c2
cross join syscolumns c3
cross join syscolumns c4
... etc
You can't just directly insert into your already created table as the identity() function need a select into clause. You can just insert from the newly created table into your XYZ operational table.
If this is not what you mean, and you have a flat file that you want to bulk load into the table, have a look at the BULK INSERT command (use TABLOCK and consider dropping any existing indexes on the table prior to the load).
Cheers,
Rob
Guess the easiest is to have t-sql script using a while loop...I thought of bcp but then I need to create a file...that would be redundant...
Anyhow thnx for the post.
|||No worries. Just remember that performing this operation within a while loop will entail 1 million individual inserts! The set based solution described above would be much faster and much more efficient. If this is a once-off operation, then it's probably not an issue.
Cheers,
Rob