I have a user VIEW, let's call it [MIKE].Table
wich does a filtered select
SELECT * FROM TABLE WHERE TL_FILTERKEY in (1,2,3)
So, if Mike connects to the server and executes
"SELECT * FROM TABLE"
he will see only part of the data from table.
There is also a procedure with dbo rights and permision to Mike for execution as
CREATE PROCEDURE tbSelect
as
SELECT * FROM TABLE
If Mike executes exec tbSelect
he will see ALL rows from Table, but not filtered.
How to write the procedure so that it will select data from the user view(filtered rows)?
I tried recreate the procedure 'WITH EXECUTE AS 'Mike'' and 'WITH EXECUTE AS CALLER', however all rows are returned.