Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Can I hide a column value?

Author  Topic 

weitzhandler
Yak Posting Veteran

64 Posts

Posted - 2009-03-09 : 21:41:01
I have username & pwd cols

I want that the user should never be able to access the pwd col

I will only create a sproc 'spValidateUser' that will return all the cols from User and it will return
N'<secret>' AS Password
, if un and pwd params much.

Is there a way?

Shimmy

guptam
Posting Yak Master

161 Posts

Posted - 2009-03-09 : 23:11:09
You can encrypt the password; is this SQL 2000 or 2005?



--
Mohit K. Gupta
B.Sc. CS, Minor Japanese
MCITP: Database Administrator
MCTS: SQL Server 2005
http://sqllearnings.blogspot.com/
Go to Top of Page

weitzhandler
Yak Posting Veteran

64 Posts

Posted - 2009-03-09 : 23:54:14
I do encrypt, I thought there is a way to avoid the user from watching the encrypted passwords.

forget it, not important

Shimmy
Go to Top of Page

guptam
Posting Yak Master

161 Posts

Posted - 2009-03-10 : 01:11:58
Heh ;-). Only thing I think is deny select on the column but I never done it. So don't know if it is a possibility...

--
Mohit K. Gupta
B.Sc. CS, Minor Japanese
MCITP: Database Administrator
MCTS: SQL Server 2005
http://sqllearnings.blogspot.com/
Go to Top of Page

shaggy
Posting Yak Master

248 Posts

Posted - 2009-03-10 : 01:15:38
mr.guptam
how can we deny column for a table
Go to Top of Page

shaggy
Posting Yak Master

248 Posts

Posted - 2009-03-10 : 01:17:32
create a view
and restrict the user to access only the view ,not table
Go to Top of Page

guptam
Posting Yak Master

161 Posts

Posted - 2009-03-10 : 01:19:37
DENY SELECT ON OBJECT::dbo.TableName(ColumnName) TO DBUserName
GO

Thanks.

--
Mohit K. Gupta
B.Sc. CS, Minor Japanese
MCITP: Database Administrator
MCTS: SQL Server 2005
http://sqllearnings.blogspot.com/
Go to Top of Page

guptam
Posting Yak Master

161 Posts

Posted - 2009-03-10 : 01:20:38
With view the user still has to have access to the underlying object; if they do not the view will fail. Thanks.

--
Mohit K. Gupta
B.Sc. CS, Minor Japanese
MCITP: Database Administrator
MCTS: SQL Server 2005
http://sqllearnings.blogspot.com/
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-03-10 : 02:53:41
but you can exclude the column form view definition altogether
Go to Top of Page
   

- Advertisement -