Re: Limiting views on data in a table

From: Mike Lerch (mlerchNOSPAMTHANKS_at_nycap.rr.com)
Date: 06/13/03


Date: Fri, 13 Jun 2003 09:23:40 -0400


On Fri, 13 Jun 2003 10:27:47 +0200, "Dejan Sarka"
<dejan_please_reply_to_newsgroups.sarka@avtenta.si> wrote:

>Mike,
>
>Maybe you could help yourself with the SUSER_SNAME() system function - it
>returns the Windows login the user uses to connect to SQL Server. You could
>use it in the WHERE clause of your single stored procedure for everybody to
>compare the current user t the user4 stored in the access table. This way
>even if the user comes to the SP directly (s)he won't be able to see
>anything but own rows.

I like that idea a lot and will give it a try! Thanks much!

>BT, the owner of the SP and all of the tables that SP uses must be the same.
>Then you can give only Execute permission on the SP. Don't grant or deny any
>permissions on the tables.

Got it. They can all be set to the dbo user in most cases, can't
they?

Lerch