Re: Sql Security ?QL

From: Uri Dimant (urid_at_iscar.co.il)
Date: 11/17/04


Date: Wed, 17 Nov 2004 10:05:12 +0200

WJ
Because you are using DYNAMIC SQL you will have to GRANT permissions on
underlying table.
To avoid this you can rewrite the dynamic code as UDF.

"WJ" <JohnWebbs@HotMail.Com> wrote in message
news:%23BAwtoFzEHA.2600@TK2MSFTNGP09.phx.gbl...
> I have the following two procedures:
>
> 1. Create Proc test1 @EmpNo Integer as
> select * from Employees where EmployeeID=@iEyeNo
> go
>
> 2. Create Proc test2 @EmpNo Integer as
> declare @sql varchar(80)
> set @sql='select * from Employees where EmployeeID='+@EmpNo
>
> EXEC @sql
> go
>
> ** I granted "Execute" privilege on both procedures above to a Windows
2003
> account called "NetWork Service". This account is used by Asp.Net
> applications to access MS/SQL Server 2000.
>
> The 1st proc works fine, however, the 2nd proc requires me to also Grant
> "Select" privilege on TABLE "Employees" to the "NetWork Service" account.
> Why is that ? I want to use the 2nd Proc because, in certain
circumstances,
> the EXEC will let me build dynamic query.
>
> Thanks,
>
> John
>
>
>
>



Relevant Pages

  • Re: JSH: At the Annals
    ... James has acted honourably in doing a ... > complete rewrite in order to avoid any potential embarrassment to ...
    (sci.math)
  • Re: Can I use ASP.NET Web Admin tool as a part of my site?
    ... I want to have teh Web Admin tool as part of my site but I want to avoid ... having to rewrite all the code to manage my users and roles. ... to incorporate the ASP.NET 2.0 webadmin tool into my site as a link? ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Delphi 2008 native?
    ... Cutting yourself off from a lot of functionality, present and future, just to avoid .Net is rather shortsighted. ... just the contrary - the development system is not stable and every ... This keeps coming up, the idea that, if it really were good, then MS would rewrite years worth of perfectly good working Win32 code in .Net just to prove it. ...
    (borland.public.delphi.non-technical)
  • Re: Converting Exists and NOT EXISTS into UDF or a View etc..
    ... Look, UDF is perfoming similar to cursor/loop,row-by row operation. ... You want to avoid using UDF on large set data. ... > from Issuer CFRAME ... > from Debt ...
    (microsoft.public.sqlserver.programming)
  • Re: TADODataset VERY Slow With MS SQL
    ... >TTable form to avoid a complete rewrite of the application, ... servers are not designed to preform the kind of sequential access you are ... need two rewrite your application to do most of the work with Queries on the ...
    (borland.public.delphi.database.ado)

Loading