USE [master]
GO

/* For security reasons the login is created disabled and with a random password. */
/****** Object:  Login [user_pacsdbname]    Script Date: 5/28/2019 3:48:32 PM ******/
CREATE LOGIN [user_pacsdbname] WITH PASSWORD=N'userpass', DEFAULT_DATABASE=[master], DEFAULT_LANGUAGE=[us_english], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
GO

ALTER LOGIN [user_pacsdbname] ENABLE
GO
-- Them quyen user cho db pacs
USE [pacsdbname]
GO
CREATE USER [user_pacsdbname] FOR LOGIN [user_pacsdbname]
GO
ALTER ROLE [db_datareader] ADD MEMBER [user_pacsdbname]
GO
USE [pacsdbname]
GO
ALTER ROLE [db_datawriter] ADD MEMBER [user_pacsdbname]
GO
USE [pacsdbname]
GO
ALTER ROLE [db_owner] ADD MEMBER [user_pacsdbname]
GO

