I am trying to use Bulk Insert for a user that is not sysadmin.
I have already set up the user as a member of "bulkadmin" .
When I run the following script:
DECLARE @SQL VARCHAR(1000)
CREATE TABLE amdbo.#temp (
[id] [varchar] (10) NULL
,[fld2] [varchar] (10) NULL
,[fld3] [varchar] (10) NULL
)
set @SQL =
'BULK INSERT amdbo.#temp
FROM ''F:\test.txt''
WITH (DATAFILETYPE = ''char'', FIELDTERMINATOR = ''|'', ROWTERMINATOR
= ''\n'')'
EXEC (@SQL)
select * from #temp
I still get the message ...
Server: Msg 8104, Level 16, State 2, Line 1
The current user is not the database or object owner of table '#temp'.
Cannot perform SET operation.
Anyone have an idea what I am doing wrong?
Drew. 3 12991
Drew (cl****@hotmail .com) writes: I am trying to use Bulk Insert for a user that is not sysadmin. I have already set up the user as a member of "bulkadmin" .
When I run the following script: DECLARE @SQL VARCHAR(1000) CREATE TABLE amdbo.#temp ( [id] [varchar] (10) NULL ,[fld2] [varchar] (10) NULL ,[fld3] [varchar] (10) NULL ) set @SQL = 'BULK INSERT amdbo.#temp FROM ''F:\test.txt'' WITH (DATAFILETYPE = ''char'', FIELDTERMINATOR = ''|'', ROWTERMINATOR = ''\n'')' EXEC (@SQL) select * from #temp
I still get the message ... Server: Msg 8104, Level 16, State 2, Line 1 The current user is not the database or object owner of table '#temp'. Cannot perform SET operation.
As I recall you cannot bulk load to temp tables if you are not sysadmin.
Or, this is somewhat weird: the user is the dbo of tempdb.
It's probably better to create a permanent table that this user is
the owner of and use that table as the target.
--
Erland Sommarskog, SQL Server MVP, so****@algonet. se
Books Online for SQL Server SP3 at http://www.microsoft.com/sql/techinf...2000/books.asp
The solution I've done is to create a physical table, populate it, and
when the procedure ends, drop the table. Which is pretty much what
you suggested.
Thanks,
Drew
Erland Sommarskog <so****@algonet .se> wrote in message news:<Xn******* *************** @127.0.0.1>... Drew (cl****@hotmail .com) writes: I am trying to use Bulk Insert for a user that is not sysadmin. I have already set up the user as a member of "bulkadmin" .
When I run the following script: DECLARE @SQL VARCHAR(1000) CREATE TABLE amdbo.#temp ( [id] [varchar] (10) NULL ,[fld2] [varchar] (10) NULL ,[fld3] [varchar] (10) NULL ) set @SQL = 'BULK INSERT amdbo.#temp FROM ''F:\test.txt'' WITH (DATAFILETYPE = ''char'', FIELDTERMINATOR = ''|'', ROWTERMINATOR = ''\n'')' EXEC (@SQL) select * from #temp
I still get the message ... Server: Msg 8104, Level 16, State 2, Line 1 The current user is not the database or object owner of table '#temp'. Cannot perform SET operation.
As I recall you cannot bulk load to temp tables if you are not sysadmin. Or, this is somewhat weird: the user is the dbo of tempdb.
It's probably better to create a permanent table that this user is the owner of and use that table as the target.
I have the similiar issues encountered. Please refer to MS
knowledgebase 302621. Microsoft has confirmed this is an software
issue. cl****@hotmail. com (Drew) wrote in message news:<d0******* *************** ****@posting.go ogle.com>... The solution I've done is to create a physical table, populate it, and when the procedure ends, drop the table. Which is pretty much what you suggested. Thanks, Drew Erland Sommarskog <so****@algonet .se> wrote in message news:<Xn******* *************** @127.0.0.1>... Drew (cl****@hotmail .com) writes: I am trying to use Bulk Insert for a user that is not sysadmin. I have already set up the user as a member of "bulkadmin" .
When I run the following script: DECLARE @SQL VARCHAR(1000) CREATE TABLE amdbo.#temp ( [id] [varchar] (10) NULL ,[fld2] [varchar] (10) NULL ,[fld3] [varchar] (10) NULL ) set @SQL = 'BULK INSERT amdbo.#temp FROM ''F:\test.txt'' WITH (DATAFILETYPE = ''char'', FIELDTERMINATOR = ''|'', ROWTERMINATOR = ''\n'')' EXEC (@SQL) select * from #temp
I still get the message ... Server: Msg 8104, Level 16, State 2, Line 1 The current user is not the database or object owner of table '#temp'. Cannot perform SET operation.
As I recall you cannot bulk load to temp tables if you are not sysadmin. Or, this is somewhat weird: the user is the dbo of tempdb.
It's probably better to create a permanent table that this user is the owner of and use that table as the target. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: php newbie |
last post by:
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...
|
by: iqbal |
last post by:
Hi all,
We have an application through which we are bulk inserting rows into a
view. The definition of the view is such that it selects columns from
a table on a remote server. I have added the servers using
sp_addlinkedserver on both database servers.
When I call the Commit API of oledb I get the following error:
Error state: 1, Severity: 19, Server: TST-PROC22, Line#: 1, msg:
|
by: Philip Boonzaaier |
last post by:
I want to be able to generate SQL statements that will go through a list of
data, effectively row by row, enquire on the database if this exists in the
selected table- If it exists, then the colums must be UPDATED, if not, they
must be INSERTED.
Logically then, I would like to SELECT * FROM <TABLE>
WHERE ....<Values entered here>, and then IF FOUND
UPDATE <TABLE> SET .... <Values entered here> ELSE
INSERT INTO <TABLE> VALUES <Values...
|
by: avicentic |
last post by:
I want to add bulkadmin permission to my applicatio role. Is it a
posible.
My windows account havo only public permission on database.
I'm using application role
EXEC sp_approlepassword 'MyRole', 'password';
Therefore I want to BULK some data with BULK INSERT command.
Error is:
|
by: Tim Satterwhite |
last post by:
Hi All,
I think this is a thorny problem, and I'm hoping you can help. I've not
found this exact issue described anywhere yet.
I have a stored procedure that calls BULK INSERT on a set of text files.
These files are FTP'd from a legacy system (a mainframe running MVS).
Sometimes, the process steps on iteslf, whereby the bulk insert is attempted
on a file whose FTP is still in progress; it's not fully written to disk on
the SQL box...
| |
by: Jennifer |
last post by:
I'm trying to do an insert using Bulk Insert with a fixed length file.
I'm using a format file.
I'm getting the following error message:
Cannot perform bulk insert. Invalid collation name for source column 16
in format file '\\wbhq.com\dfsdv\iDataInt\GOPFiles\GOPFormatFile.txt'.
Any suggestions are appreciated.
Thanks!
Jennifer
|
by: nano |
last post by:
Does sql server have a way to handle errors in a sproc which would allow
one to insert rows, ignoring rows which would create a duplicate key
violation? I know if one loops one can handle the error on a row by row
basis. But is there a way to skip the loop and do it as a bulk insert?
It's easy to do in Access, but I'm curious to know if SQL Server proper
can handle like this. I am guessing that a looping operation would be
slower to...
|
by: DTV12345 |
last post by:
Hello!
I have been assigned to bulk-load data into several typed tables of our ODS. I am not clear as to whether it can be done.
Here's my homework ===>>>
The easy way is to perform INSERT statements manually, like this
insert into
callbacks
|
by: Inbaraj |
last post by:
HI..
I want to perform Bulk Insert of data using C# and oracle can any one help me how to perform this operation....
Plz help me with sample code.....
with reg
Inba
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |