DatabaDatabase security for one person en deference applications

  • Hello,

    I have a problem.

    We have several applications and persons.

    I think that my problem best can tell by an example:

    We use SQL2000 and SQL2005

    We have 1 person named Harry.

    one database named ExampleDB.

    and two applications named App1 and App2.

    I would know if the example below is possible?

    If Harry start the application App1, the application connect to the database ExampleDB with the rights dataread and datawrite.

    If Harry start the application App2, the application connect to the database ExampleDB with the rights datareader.

    Does anybody know of this is possible and if yes how i can do this.

    Raymond

  • Yes, you can do it by adding a login for Harry to SQL Server and adding a user for Harry in ExampleDB, then making the user a member of the fixed database roles db_datareader and db_datawriter. The application's connection string would include the login, instance name, and database name.

    A more secure way to do it would be to put the DML statements in stored procedures and granting EXECUTE permissions on them to the user in ExampleDB. Then, Harry wouldn't need read and write permissions. Also, if Harry isn't the only user of the application, you should use an application login that is not related to any individual to connect to the database.

    Greg

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply