Showing posts with label sysadmin. Show all posts
Showing posts with label sysadmin. Show all posts

Saturday, February 25, 2012

Bulk Insert - Cannot perform SET operation.

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 @.SQLVARCHAR(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.Drew (cladre@.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, sommar@.algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../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 <sommar@.algonet.se> wrote in message news:<Xns9402F24BBF061Yazorman@.127.0.0.1>...
> Drew (cladre@.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.

cladre@.hotmail.com (Drew) wrote in message news:<d00212d6.0310200700.3b2bca9f@.posting.google.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 <sommar@.algonet.se> wrote in message news:<Xns9402F24BBF061Yazorman@.127.0.0.1>...
> > Drew (cladre@.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.

Thursday, February 16, 2012

BuiltinAdministrator's not SysAdmin yet appear to have DBO on all

Hi All,
I have revoked the BUILTIN\Administrators group membership in the SysAdmin
group of a SQL 2000 server and instead granted the group Process
Admoinistrators and Disk Administrators permissions. When I browse
permissions for the BUILTIN\Administrators group in EM, I see the proper
Server Roles are defined as noted above, however this group appears to have
DBO permissions to all databases on the server, even though those databases
were created by SA. In checking several of my SQL servers I am also seeing
the same thing on each server. Have people seen this before? This would
imply that the Local Admins to the box stil have dbo to all of the databases
,
but they were never granted this permission. Is this just in incorrect
representation within EM?
Thanks,
DaveNo...that's not what would typically happen if you remove
the Builtin\administrators group.
I'm guessing that you mean that the local admins appear to
have db_owner role permissions DBO and db_owner are
different things. DBO is a user and db_owner is a database
role. Users can be members of db_owner fixed database role
which gives them all permissions in the database.
I'm not sure why you think the local admins on the server
have db_owner permissions but one thing to keep in mind is
that permissions are cumulative based upon the users
explicit permissions as well as those inherited from group
membership (Windows groups as well as the server and
database groups).
-Sue
On Sun, 23 Jan 2005 06:33:03 -0800, "DBADave"
<DBADave@.discussions.microsoft.com> wrote:

>Hi All,
>I have revoked the BUILTIN\Administrators group membership in the SysAdmin
>group of a SQL 2000 server and instead granted the group Process
>Admoinistrators and Disk Administrators permissions. When I browse
>permissions for the BUILTIN\Administrators group in EM, I see the proper
>Server Roles are defined as noted above, however this group appears to have
>DBO permissions to all databases on the server, even though those databases
>were created by SA. In checking several of my SQL servers I am also seein
g
>the same thing on each server. Have people seen this before? This would
>imply that the Local Admins to the box stil have dbo to all of the database
s,
>but they were never granted this permission. Is this just in incorrect
>representation within EM?
>Thanks,
>Dave

builtin\administrators login and database access

How do I remove db_owner access from the
builtin\administrators sql login?
The db_owner and sysadmin roles have been assigned to the
windows domain account that starts SQL Server and the sa
login for all db's.
I need to remove this for secutiry/legal reason.
Any problems if I just remove the builtin\administrators
login?
Thanks."Matt Troska" <matt.troska@.co.mcleod.mn.us> wrote in message
news:495f01c3e42f$efd44e50$a501280a@.phx.gbl...
quote:

> How do I remove db_owner access from the
> builtin\administrators sql login?

You don't want to do that...
quote:

> The db_owner and sysadmin roles have been assigned to the
> windows domain account that starts SQL Server and the sa
> login for all db's.
> I need to remove this for secutiry/legal reason.
> Any problems if I just remove the builtin\administrators
> login?

That's the correct approach, as long as you've granted another group/user
sysadmin equivalence, then you can safely delete the builtin\administrators
group.
After I install SQL Server and setup the security, deleting the
builtin\administrators group is usually one of the first steps I take.
Steve

Tuesday, February 14, 2012

builtin admin - OOOPS

Lets say a dba removes the builtin admin group from the sql server in haste.
They donâ't have any other logins with sysadmin rights, and they donâ't know
the SA password. How would they get sysadmin rights back?It would be difficult to start the services using some service account if there is no service
account with sysadmin privileges. For instance, Agent refuses to start unless it is sysadmin. Worst
case, you use LocalSystem as service account, then it is more difficult since you cannot use this
interactively. In that case, I guess you are in for a rebuild of the system databases.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Jason" <Jason@.discussions.microsoft.com> wrote in message
news:4ED73AA6-A4A1-452E-877B-2135C0804FC7@.microsoft.com...
> Lets say a dba removes the builtin admin group from the sql server in haste.
> They donâ't have any other logins with sysadmin rights, and they donâ't know
> the SA password. How would they get sysadmin rights back?