Re: permissions for Desktop engine

From: Dan Guzman (danguzman@nospam-earthlink.net)
Date: 06/06/02


From: "Dan Guzman" <danguzman@nospam-earthlink.net>
Date: Thu, 6 Jun 2002 08:09:22 -0500


You can setup security with system stored procedures and execute these
with the OSQL utility or any ad-hoc SQL application. The basic steps
are to add the login to SQL Server, grant database access and role
membership (optional). Below are some untested examples. See the Books
Online for details.

--add SQL Authentication login
EXEC sp_addlogin 'MyLogin', 'MyPassword'
EXEC sp_defaultdb 'MyLogin', 'MyDatabase'

--add Windows Authentication login (existing Windows user)
EXEC sp_grantlogin 'MyDomain\MyLogin'
EXEC sp_defaultdb 'MyDomain\MyLogin', 'MyDatabase'

USE MyDatabase

--setup object permissions
EXEC sp_addrole 'MyRole'
GRANT ALL ON MyTable TO MyRole

--grant database access
EXEC sp_grantdbaccess 'MyLogin'
EXEC sp_grantdbaccess 'MyDomain\MyLogin'

--add role membership
EXEC sp_addrolemember 'MyRole', 'MyLogin'
EXEC sp_addrolemember 'MyRole', 'MyDomain\MyLogin'

--
Hope this helps.
Dan Guzman
SQL Server MVP
-----------------------
SQL FAQ links (courtesy  Neil Pike):
http://www.ntfaq.com/Articles/Index.cfm?DepartmentID=800
http://www.sqlserverfaq.com
http://www.mssqlserver.com/faq
-----------------------
"Cedric Zaugg" <czaugg@aesa.ch> wrote in message
news:adn6li$h4v$1@rex.ip-plus.net...
> Hi,
>
> How can I setup usernames and passwords for the Desktop engine without
> having the Entreprise Manager installed?
>
> Thanks,
> Cedric
>
>


Relevant Pages

  • Re: permissions for Desktop engine
    ... > with the OSQL utility or any ad-hoc SQL application. ... > EXEC sp_defaultdb 'MyLogin', 'MyDatabase' ... > GRANT ALL ON MyTable TO MyRole ...
    (microsoft.public.sqlserver.security)
  • Re: Full text catalog just not populating
    ... exec sp_defaultdb N'NT Authority\System', N'master' ... means either the network guys in my company who don't know SQL but are admins ... > needs this login to log into SQL Server and you can either add back this ... >> fetching U ...
    (microsoft.public.sqlserver.fulltext)
  • Re: Indexing delay for one row.
    ... script and WAITFOR and varying the delay from 1 to 18 seconds. ... could you confirm your exact version of SQL Server that you are seeing ... It is possible that a change was made to the pooling frequence under SP3 to ... exec sp_fulltext_table 'FTSTable','create','FTSCatalog','FTSTable_IDX' ...
    (microsoft.public.sqlserver.fulltext)
  • Re: storing and searching office docs in SQL
    ... You CAN both store and search the contents of the MS Word ... files stored in an SQL Table's FT-enable IMAGE column, ... FTS CONTAINS or FREETEXT to search the contents of that MS word document: ... exec sp_fulltext_database 'enable' -- only do this once! ...
    (microsoft.public.sqlserver.programming)
  • Re: SqlDataAdapter1.SelectCommand.CommandType= CommandType.StoredProcedure
    ... > kann man beim EXEC PROC keine Parameter beifügen. ... CommandType.StoredProcedure wird intern als RPC Command abgesetzt, ... SQL RPC siehe SQL Server Dokumentation, ... nach der Ausführung ungültig werden. ...
    (microsoft.public.de.german.entwickler.dotnet.datenbank)