Wednesday, March 28, 2012

how to assign the view to a user?

im using the Northwind database, i use T-SQL commands to create a view that restricts users from seeing the address, city for all employees.
i dont know how to assign the view to a user in the database using Enterprise manager.
pls help me, im really needing a answer.
thanks!

What do you mean by assign a view to a user, do you just want to grant him Select permissions on the view, or do you want the user to be the owner of the view ?

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de|||i want the user to be the owner of the view
pls, step by step.
thanks.|||

sp_changeobjectOwner 'dbo.MyTable', 'Scott' -- this will grant ownership of the object to a user named 'Scott'

Check out my SQL Server 2005 Video Tutorials: http://www.learnsqlserver.com/

|||But you should be aware that sp_changeobjectowner is for SQL 2000 only. It is still existing for SQL 2k5 but should not be used anymore in SQL2k5. Use the other options mentioned in the BOL (look in the entry sp_changeobjectowner)

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de

No comments:

Post a Comment