You can create users in SQL Server using a script where you read the values from a table. If they are SQL users (not Windows users), you could write a NAV program to load the users in the user table (or use SQL if you are careful).
This script could generate the TSQL to create the logins/user on basisi of the NAV site "Database Logins" (no Windows Logins):
set statistics io off
go
declare @userid varchar(20), @tsql varchar(1000)
declare user_cur cursor for select [User ID] from Navision.dbo."User" -- change db name!
open user_cur
fetch next from user_cur into @userid
while @@fetch_status = 0 begin
set @tsql =
'
USE [master]
GO
CREATE LOGIN [' + @userid + '] WITH PASSWORD = ''welcome'', CHECK_POLICY = OFF
GO
use [Navision] -- change db name!
GO
CREATE USER [' + @userid + '] FOR LOGIN [' + @userid + ']
GO
'
print @tsql
fetch next from user_cur into @userid
end
close user_cur
deallocate user_cur
But caution :shock: : the default password "welcome" is assigned to ALL users, you have to assure that users are changing it ASAP! The SQL feature MUST_CHANGE and CHECK_EXPIRATION do not work with NAV!
Comments
http://mibuso.com/blogs/davidmachanick/
This script could generate the TSQL to create the logins/user on basisi of the NAV site "Database Logins" (no Windows Logins): But caution :shock: : the default password "welcome" is assigned to ALL users, you have to assure that users are changing it ASAP! The SQL feature MUST_CHANGE and CHECK_EXPIRATION do not work with NAV!
NAV/SQL Performance Optimization & Troubleshooting
STRYK System Improvement
The Blog - The Book - The Tool