in

CodeSmith Community

Your Code. Your Way. Faster!

SELECT permission required on GetPaged method

Last post 12-21-2006 3:04 PM by ovalsquare. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 12-19-2006 7:52 PM

    SELECT permission required on GetPaged method

    I must be delirious, but why would I need SELECT permission on a table in my database when a ServiceLayer GetPaged method is called? The user for the database that I am using is permitted EXEC permission on the generated GetPaged stored procedure, but I'm still getting the error  <Message>SELECT permission denied on object 'Log', database 'DatabaseName', owner 'dbo'.</Message>. Btw, it's accessing the Log table from EAB.

     Timestamp: 12/20/2006 1:42:20 AM
    Message: HandlingInstanceID: 95609400-aea2-4ddc-8fa1-bb016873c730
    <Exception>
      <Description>An exception of type 'System.Data.SqlClient.SqlException' occurred and was caught.</Description>
      <DateTime>2006-12-19 17:42:20Z</DateTime>
      <ExceptionType>System.Data.SqlClient.SqlException, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType>
      <Message>SELECT permission denied on object 'Log', database 'DatabaseName', owner 'dbo'.</Message>
      <Source>.Net SqlClient Data Provider</Source>
      <HelpLink />
      <Property name="Errors">System.Data.SqlClient.SqlErrorCollection</Property>
      <Property name="Class">14</Property>
      <Property name="LineNumber">1</Property>
      <Property name="Number">229</Property>
      <Property name="Procedure" />
      <Property name="Server">LAPTOP\SQL2000</Property>
      <Property name="State">5</Property>
      <Property name="ErrorCode">-2146232060</Property>
      <Property name="Data">System.Collections.ListDictionaryInternal</Property>
      <Property name="TargetSite">Void OnError(System.Data.SqlClient.SqlException, Boolean)</Property>
      <StackTrace>   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)

      <additionalInfo>
        <info name="MachineName" value="LAPTOP" />
        <info name="TimeStamp" value="12/20/2006 1:42:20 AM" />
        <info name="FullName" value="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" />
        <info name="AppDomainName" value="/LM/W3SVC/7/Root-7-128110518606093750" />
        <info name="ThreadIdentity" value="Testing" />
        <info name="WindowsIdentity" value="LAPTOP\ASPNET" />
      </additionalInfo>
    </Exception>
    Category: Exceptions
    Priority: 0
    EventId: 100
    Severity: Error

    Am I missing something obvious here?

    Thanks,

     Ted

    • Post Points: 65
  • 12-20-2006 3:07 AM In reply to

    • swin
    • Top 10 Contributor
    • Joined on 06-14-2006
    • London, UK
    • Posts 921
    • Points 34,675

    Re: SELECT

    No, I don't think you need to start taking the tablets yet! Its because NT uses dynamic SQL for some operations.

    HTH

    swin

    -------------------------------------------------
    Member of the .NetTiers team
    -------------------------------------------------
    • Post Points: 5
  • 12-21-2006 12:13 PM In reply to

    Re: SELECT

    From what I have seen, if you don't set in the config file to use stored procedures, then it uses sql stored in an xml file.
    • Post Points: 35
  • 12-21-2006 3:04 PM In reply to

    Re: SELECT

    Stan: config is set to use stored procedures.

    Swin: I had already looked at the sp but, gasp, I'm embarassed to say that I didn't know that when executing dynamic SQL with sp_executesql from a stored procedure that the SQL is executed in the permission context of the user, not the calling procedure. Embarrassed My shame is posted here for any others that need the help while seeking anonymity.

    • Post Points: 5
Page 1 of 1 (4 items)
Copyright © 2008 CodeSmith Tools, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems