locked
Which user should I use? RRS feed

  • Question

  • Not sure if this is the correct place to post this question or not... so let me know if there's a better place.

    We've created a batch script on a windows server that we will be executing remotely from a different server. This batch script will make some changes to a table that's on our SQL Server 2008 box. 

    Question is: What user does that batch script need to be run as, so that it will have the proper permissions to make the changes we need?

    So to kind of lay it out:

    Machine 1: Application is run that tells Machine 2 to run a local batch script.
    Machine 2: Local Batch Script runs that makes changes to tables in SQL2008 on Machine 3.
    Machine 3: SQL2008 machine.

    Any help would be appreciated! Thanks Guys!
    SysChaos

    Tuesday, September 22, 2009 1:53 PM

Answers

  • Are you in a domain environment?  If you are, and would like to use Windows Integrated Authentication, you should provision the user on the DB with sufficient permissions to perform the tasks you wish.  On machine 2 (where the batch is executed) you should run the script as the same user you have provisioned on the DB. 

    Add "Integrated Security=SSPI;" to your connection string to use Integrated Authentication.

    Otherwise, you can always use SQL Authentication.

    Tuesday, September 22, 2009 9:38 PM