Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

sql server 2008 how do I create view by other user

Posted on 2014-11-11
9
87 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 13

Expert Comment

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

Author Comment

by:madmare
ID: 40436753
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
ID: 40436758
something like execute command as other user
0
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 
LVL 13

Expert Comment

by:Koen Van Wielink
ID: 40436763
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
 

Author Comment

by:madmare
ID: 40436765
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
ID: 40436770
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
ID: 40436771
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
ID: 40436773
use this :

EXEC sp_changeobjectowner 'view_name', 'your_domain_name\yuv123'

Open in new window

0
 
LVL 48

Accepted Solution

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

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SSRS - Date Report Options 2 28
SQL Query 2 31
MS SQL Server select from Sub Table 14 23
SQL Recursion 6 18
In this article I will describe the Copy Database Wizard 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.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
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.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

856 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