Object does not exist error is getting if VIEW DEFINITION denied

  • I have denied VIEW DEFINITION permission of all the objects of a database for a particular user. But he is getting an error like "Object does not exist or you do not have permission" while he is trying to execute some stored procedures. This error is coming ONLY for few stored procedures and rest everything is working properly. If I grant the View Definition permission to those objects it will work properly.

    What could be the issue? Kindly help.

    _____________________________________________
    One ounce of practice is more important than tonnes of dreams

  • C.K.Shaiju (1/19/2009)


    I have denied VIEW DEFINITION permission of all the objects of a database for a particular user. But he is getting an error like "Object does not exist or you do not have permission" while he is trying to execute some stored procedures. This error is coming ONLY for few stored procedures and rest everything is working properly. If I grant the View Definition permission to those objects it will work properly.

    What could be the issue? Kindly help.

    GRANT EXECUTE Permission on object this will resolve your problem.

    Abhijit - http://abhijitmore.wordpress.com

  • What do those few stored procs that fail do that the ones that work don't? Access the system tables?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Hi Abhijit,

    EXECUTE permission is already there. When I DENY VIEW DEFINITION permission it is giving the above error, otherwise not.

    Hi Gail,

    Those sps are not accessing any system tables.

    Thanks,

    Shaiju C.K.

    _____________________________________________
    One ounce of practice is more important than tonnes of dreams

  • Please find one of the sp script below.

    ALTER PROCEDURE [dbo].[pLoadDoctors]

    @WardID SMALLINT

    AS

    SET NOCOUNT ON

    BEGIN

    SELECT

    distinct Doc.ID as DoctorId ,

    (Doc.DoctorCode + ' - ' + Doc.DoctorName) as DoctorCode

    FROM tblRegistration C

    JOIN tblADMISSION AS AD ON AD.MRN=C.MRN AND AD.VisitNumber=C.VisitNumber

    JOIN tblSecondaryAttendingDoctors as RD on RD.MRN = C.MRN AND RD.VisitNumber=C.VisitNumber AND RD.IsDeleted =0

    JOIN tblStatusMaster as SM ON SM.ID=C.RegistrationStatusID AND SM.ID <> 4

    JOIN tblBedMaster as Bed on AD.BedId = Bed.ID

    JOIN tblRoomMaster as Ro on Ro.Id = Bed.RoomId

    JOIN tblWardMaster as W on W.ID = Ro.WardID

    JOIN tblStatusMaster as S on S.ID = RD.StatusID

    JOIN tblDoctorMaster As Doc on RD.DoctorID = Doc.ID

    where W.ID = @WardID

    AND AD.Isdeleted =0

    AND ( C.RegistrationStatusID=1 OR C.RegistrationStatusID=5 ) -- only for open & Discharged visits

    AND C.VisitTypeID = 3 AND C.ChargetypeID ='2' -- considering only the Admission

    AND AD.ChargeTypeID = '2'

    AND C.ISDeleted =0

    Order by (Doc.DoctorCode + ' - ' + Doc.DoctorName) asc

    END

    _____________________________________________
    One ounce of practice is more important than tonnes of dreams

  • I don't see anything that stands out as causing the view definition right to be needed. All of these have the tbl prefix, so I'm assuming all are tables and not views. This sounds like a bug. If no one else comes up with an answer other than "grant the permission," you may want to consider posting it on connect.microsoft.com under SQL Server.

    K. Brian Kelley
    @kbriankelley

  • grant exec on [sp] to

  • The Error message is:

    "domain\user does not have permission to alter object 'mf20'..................."

    I gone through the work around and found the solution as below:

    Open Services, go to Analysis services--->right click on it --> Properties-->LogOn --> select This Account -->give server and your user name here. confirm it is your user, click ok.

    Stop the service and again start the service. check the service Log On As in your user name.

    Thant's it. save your cube in BIDS and close and reopen the cube, then deploy the cube. it will deploy and process it.

    I hope this will help.

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply