-- Create user for IONE DSD login and map the user to ION DSD role

IF exists (SELECT * FROM sys.server_principals WHERE name = N'ionedsd') AND not exists (SELECT * FROM sys.database_principals WHERE name = N'ionedsd')
BEGIN
	CREATE USER [ionedsd] FOR LOGIN [ionedsd]
	ALTER USER [ionedsd] WITH DEFAULT_SCHEMA=[ION_DSD_Reader]
	EXEC sp_addrolemember N'ION_DSD_Reader', N'ionedsd'
END
GO

