Groups | Blog | Home
all groups > sql server connect > october 2005 >

sql server connect : Owner's Access to table


Jim Bunton
10/17/2005 12:00:00 AM
SQL SERVER 2000 Personal Edition
Win 2000

Connect using SqlServer Authentification
Jim **pw**

Run the following to create a new table:-
--------------------------
USE SolutionsNet
GO
CREATE TABLE
Companies
(CompanyId INT PRIMARY KEY IDENTITY(1,1),
Companyname VarChar(50) NOT NULL,
IsaRestaurant BIT,
. . . . .
)
GO
--------------------------

Then the following:-
--------------------------
Use SolutionsNet
GO
SELECT * FROM Companies
REM OR select * from jim.Companies
GO
--------------------------
Server: Msg 229, Level 14, State 5, Line 1
SELECT permission denied on object 'Companies', database 'SolutionsNet',
owner 'Jim'.

BUT
connect as sa **pw**
--------------------------
USE SolutionsNet
GO
SELECT * FROM Jim.Companies
GO
--------------------------
Displays the empty table Ok

[NB. just Companies without tyhe prefix Jim. does not display the empty
table
Server: Msg 208, Level 16, State 1, Line 1
Invalid object name 'Companies'. ]

????
Why can I not access the table connected as Jim - it's owner !!!
???



Jim Bunton

Jim Bunton
10/17/2005 12:00:00 AM
Ok - got the answer on sqlserver.tools group -
I'd 'clicked' all roles 'to make sure!!!!" one of them is 'denydatareader' -

[quoted text, click to view]


[quoted text, click to view]

Jens
10/17/2005 7:54:48 AM
He must be in some groups which denies seeing table data. Try to
determine this via sp_helpuser 'Username'

HTH, jens Suessmeyer.
AddThis Social Bookmark Button