PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Hébergement serveur > comp.db.ms-sqlserver > Imitating ownership possible?
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Imitating ownership possible?

Réponse
 
LinkBack Outils de la discussion
Vieux 20/12/2007, 14h53   #1
javelin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Imitating ownership possible?

In order to run SQL queries without having to fully qualify ownership,
I know it's necessary to either give ownership to the DBO or log in to
the server as the object owner. The goal I have is to allow entry of a
SQL statement having without logging in as that user and without
having to fully qualify ownership. I know we can USE a different
database easily, so is it also possible to use a different user in
Query Analyzer as the default? That would make life so much easier
than reconnecting as a different user.

Thanks.

J

  Réponse avec citation
Vieux 20/12/2007, 15h22   #2
Plamen Ratchev
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Imitating ownership possible?

In SQL Server 2000 you could use the SETUSER command
(http://msdn2.microsoft.com/en-us/lib...0(SQL.80).aspx) to
impersonate the user context for a SQL user account. However, this can only
be used by a sysadmin or db_owner and could not be used for Windows
accounts. In SQL Server 2005 you can use the EXECUTE AS clause to change the
execution context.

Here is a good article about EXECUTE AS:
http://blogs.msdn.com/sqlserverstora...21/642061.aspx

HTH,

Plamen Ratchev
http://www.SQLStudio.com

  Réponse avec citation
Vieux 20/12/2007, 15h33   #3
javelin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Imitating ownership possible?

Awesome. Thanks for the quick response. I've got a lot of experience
in SQL in other languages, and some in SQL Server, but all the little
tricks of the trade I'm still short on.

Thanks again.

J
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 05h06.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,11219 seconds with 11 queries