Re: Using osql.exe to set account permissions?

From: Keith Kratochvil (keith.kratochvil.back2u@novusprintmedia.com)
Date: 06/11/02


From: "Keith Kratochvil" <keith.kratochvil.back2u@novusprintmedia.com>
Date: Tue, 11 Jun 2002 09:57:58 -0500


This should be possible. I would try this using three separate calls to the
database server. You will need to call
sp_grantlogin
sp_grantdbaccess
sp_addrolemember

You can find out about the specific usage of these commands within Books
Online. If you do not have it already, you can download it from Microsoft:
http://www.microsoft.com/sql/techinfo/productdoc/2000/default.asp

--
Keith, SQL Server MVP
"John" <noone@nowhere.org> wrote in message
news:eBjeeMVECHA.2448@tkmsftngp02...
> I have MSDE installed on my system and I need to create a login and set
> permissions with osql.exe (specifically I am trying to do the "Set Account
> Permissions for the SQL Server" as mentioned in this tech article
> http://support.microsoft.com/default.aspx?scid=kb;en-us;Q322235). I would
> like to use Enterprise Manager but I do not have access to it. Can I do
the
> following using osql.exe:
>
> Create a New Login
> Enter the Domain\UserName for the login
> Set the login for the database box_LM_W3SVC_1_Collab
> Permit database access for that login to that database
> Turn on the db_datareader role for that login for that database
>
> Can all of the above be done using osql.exe or any other utility that
comes
> with the standard MSDE install? If it can be done how would I do it?
>
> Thank you to anyone that can provide help!
>
> Best Regards,
> John
>
>


Relevant Pages

  • Re: Install MSDE w/ MSDE Depl.Toolkit. What permissions when using Win Auth?
    ... I created a login using Enterprise Manager on SQL Server on my server. ... Database Access tab I ticked the tick box for the database that I ... Now when my user installed the MSDE database on his machine locally, ...
    (microsoft.public.sqlserver.msde)
  • Re: SQL Server 2005 Express Remote connection
    ... I have also deleted the login for Fred from the list of users for my ... So Fred no longer exists as a login or as a user in the SQL Server setup. ... the database? ...
    (microsoft.public.sqlserver.server)
  • Re: Installation OK, but cant connect
    ... > created an access database. ... SQL Server authentication is "client" independent.... ... connections or SQL Server authenticated connections... ... which authenticate user's login at the windows login step... ...
    (microsoft.public.sqlserver.msde)
  • Re: Moving a database to another server
    ... onto a server at home. ... The database has a user that has public, db_owner, ... SQL Server login or a Windows login. ...
    (microsoft.public.sqlserver.server)
  • Re: Setting up Linked server to MsAccess
    ... At the server level I have added my windows user group ... At the database level I have added my Server login ...
    (microsoft.public.sqlserver.security)