可以执行如下SQL语句实现账号的创建和只读权限的授权:USE [master]
GO
CREATE LOGIN [test] WITH PASSWORD=test, DEFAULT_DATABASE=[TestDB], CHECK_EXPIRATION=OFF, CHECK_POLICY=ON
GO
use [TestDB];
GO
use [master];
GO
USE [TestDB]
GO
CREATE USER [test] FOR LOGIN [test]
GO
USE [TestDB]
GO
ALTER ROLE [db_datareader] ADD MEMBER [test]
GO