Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 93
  • Last Modified:

sql server 2008 how do I create view by other user

Hi All,
 
 How do I in Sql server create a View / Table by other user ?

Thanks
0
madmare
Asked:
madmare
  • 4
  • 2
  • 2
  • +1
1 Solution
 
Koen Van WielinkIT ConsultantCommented:
Can you please clarify what you mean with "by other user"?
0
 
madmareAuthor Commented:
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
 
madmareAuthor Commented:
something like execute command as other user
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
Koen Van WielinkIT ConsultantCommented:
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
 
madmareAuthor Commented:
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
 
Haris DjulicCommented:
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
 
madmareAuthor Commented:
How do I make him the owner of the table ?

not only to give him select permission
0
 
Haris DjulicCommented:
use this :

EXEC sp_changeobjectowner 'view_name', 'your_domain_name\yuv123'

Open in new window

0
 
Vitor MontalvãoMSSQL Senior EngineerCommented:
I wrote 3 articles about Views. I recommend you to read my 2nd article so it can clarifies you about Views..
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 4
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now