Re: Using osql.exe to set account permissions?

From: Keith Kratochvil (
Date: 06/11/02

From: "Keith Kratochvil" <>
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

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:

Keith, SQL Server MVP
"John" <> wrote in message
> 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
>;en-us;Q322235). I would
> like to use Enterprise Manager but I do not have access to it. Can I do
> 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
> 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