Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / General / Security / July 2008

Tip: Looking for answers? Try searching our database.

Row level security

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
SF - 24 Jul 2008 02:23 GMT
Hi,

I have an Access 2003 FE connected to SQL Server 2005 backend. I want to
identify each row of tables against each users, so I add a column 'Owner'
and have a default value to (suser_sname()).

I add a test record and found that (suser_sname()) return Domain\username.
Is there a way to store only username in the column?

SF
Russell Fields - 24 Jul 2008 02:58 GMT
Depends on how you define your users, but if you strip the login's domain
component from the username, you could use user_name().

RLF

> Hi,
>
[quoted text clipped - 6 lines]
>
> SF
Erland Sommarskog - 24 Jul 2008 10:41 GMT
> I have an Access 2003 FE connected to SQL Server 2005 backend. I want to
> identify each row of tables against each users, so I add a column 'Owner'
> and have a default value to (suser_sname()).
>
> I add a test record and found that (suser_sname()) return Domain\username.
> Is there a way to store only username in the column?

Could use substring and charindex to strip out that part, but I don't
really see the point with it.

Signature

Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.