Solved

sql server 2008 how do I create view by other user

Posted on 2014-11-11
9
79 Views
Last Modified: 2014-11-13
Hi All,
 
 How do I in Sql server create a View / Table by other user ?

Thanks
0
Comment
Question by:madmare
  • 4
  • 2
  • 2
  • +1
9 Comments
 
LVL 12

Expert Comment

by:Koen Van Wielink
Comment Utility
Can you please clarify what you mean with "by other user"?
0
 

Author Comment

by:madmare
Comment Utility
my username in the server is jmua123
I have another username which is yuv123

I need a syntax write a create command which be executed as yuv123 & NOT by me jmua123

so yuv123 wil be the creator & owner etc.. of this table
0
 

Author Comment

by:madmare
Comment Utility
something like execute command as other user
0
 
LVL 12

Expert Comment

by:Koen Van Wielink
Comment Utility
Could you clarify why you need to do this? Also, if this other user has rights to create and own a view, why don't you just login as this user and run the command under that login?
0
Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

 

Author Comment

by:madmare
Comment Utility
I cannot login by the second username name because the permissions are windows authentications

In addition we connect the sql server via Citrix

the second user doesn't have a citrix account, so it's a little bit difficult to login as the second user
0
 
LVL 15

Expert Comment

by:Haris Djulic
Comment Utility
If you wnat other user to use or be able to select from view you can grant him select by using this
GRANT SELECT ON DB_NAME.VIEW_NAME TO [your_domain_name\yuv123];

Open in new window


and if you wand that user to be able to give grants to other users you just add WITH GRANT OPTION after his username.

And since you mentioned it is domain user you need to put his username in following form [domain\user] i.e. [your_domain_name\yuv123]
0
 

Author Comment

by:madmare
Comment Utility
How do I make him the owner of the table ?

not only to give him select permission
0
 
LVL 15

Expert Comment

by:Haris Djulic
Comment Utility
use this :

EXEC sp_changeobjectowner 'view_name', 'your_domain_name\yuv123'

Open in new window

0
 
LVL 45

Accepted Solution

by:
Vitor Montalvão earned 500 total points
Comment Utility
I wrote 3 articles about Views. I recommend you to read my 2nd article so it can clarifies you about Views..
0

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now