From SQL 2005, it allow us to create the application role. After user connect to the database, it can use sp_setrole to switch the security context .
USE [TestDB]
GO
CREATE APPLICATION ROLE [ExcelRole] WITH PASSWORD = N'Pass@word'
GO
USE [TestDB]
GO
ALTER AUTHORIZATION ON SCHEMA::[db_datareader] TO [ExcelRole]
GO
0 comments:
Post a Comment