I have created an external table on my db with ADMIN user.
CREATE EXTERNAL TABLE ext.mytable
(...)
WITH (DATA_SOURCE = [DB in another server],SCHEMA_NAME = N'dbo',OBJECT_NAME = N'otherTable')
My external tables are in schema ext
. Only administrator can see tables in ext
schema.
Then I create a VIEW that SELECT rows from the external table:
CREATE VIEW live.MyView AS SELECT * FROM ext.mytable
My user own the schema live
.
Then I granted SELECT permissions on that table to my user.
GRANT SELECT ON ext.mytable TO user_service
Finally I connect to db with user_service
and I try to query the table:
SELECT * FROM ext.mytable
But I get this error:
The SELECT permission was denied on the object 'mytable', database 'insights-dwh', schema 'ext'.
The table in datasource referenced by the external table own to another user in a different server. So the admin who created the external table is different from the table referenced.
What's wrong in granting permissions? How can I solve the problem?
Thank you