• A few questions. Do you want to have all users have the same permission?

    If that is the case, you can just make NT Group from AD and add that NT group into SQL server.

    If you really really want to do, I think other people have better idea but my approch would be,

    1. import csv file into staging table. Assume table name is "AD_Users"

    2. Run this "select 'EXEC sp_grantlogin [' + usename+ ']' + char(13) + 'GO' + char(13)

    Assume username has "Domain\Username" format, if not, you can change that to like this.

    "select 'EXEC sp_grantlogin [Domain\' + loginname + ']' + char(13) + 'GO' + char(13)"

    And change above query to assign permission, add to db access, etc.

    Still, I am sure there is a lot better way and I still like NT group solution so that you don't have to worry about add/move logins everytime there is new hire and lay off.

    Also, I am not sure why all domain user need to access sql server as well.