MIcrosoft SQL Server:Create New Database User for Login.

** Execute this Query **

USE [master]
GO
 

CREATE LOGIN [LoginName] WITH PASSWORD=N'Password', DEFAULT_DATABASE=[master], DEFAULT_LANGUAGE=[us_english], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
GO
 

USE [DatabaseName]
GO
 

CREATE USER [DatabaseUserName] FOR LOGIN [LoginName]
GO
 

USE [DatabaseName]
GO
 

EXEC sp_addrolemember N'db_datareader', N'DatabaseUserName'
GO

Comments

Popular posts from this blog

Agent Installation on Windows Server. SQL Server (Failover Cluster) target addition in OEM 12c

Oracle 10g/11g Linux:SMS the alert logs ORA- errors generated in timestamp

Oracle 11g: Install Instant Client 11.2.0.3.0 on Linux x86_64 Server.