In the development of data integration, it is often necessary to create views for each other so that they can view some of the necessary data. Create a user in the database and assign permissions to the user to query the view
First, SQL Server
--Create Login user account
Use [Master]gocreate LOGIN [Kyst] with password=n ' xxx ', default_database=[rdsyscasv121003], Check_expiration=off, Check_policy=on
--Create database user use [rdsyscasv121003]gocreate user [Kyst] for LOGIN [Kyst];
--Assigning permissions
Grant SELECT on View_hr to Kyst with GRANT OPTION;
SQL Server can refer to: http://www.cnblogs.com/xwdreamer/archive/2012/06/25/2562828.html
Second, Oracle
--1, creating a view with a user with DBA authority create user Kyst identified by 123456 account Unlock;grant Connect to kyst;grant Create any view To Kyst;--2, a user with DBA authority to create a view and assign permissions to the "create" or replace view Share_hras (SELECT ID idfrom s_hr); GRANT Select on share_hr to Kyst with Grant Option;--3, Kyst user's role creates a view create or replace view Share_unit as sel ECT * from RDSYSCASV121003. SHARE_HR;
SQL Server and Oracle CREATE view users