創建用戶我有SQL Server用戶在數據庫中,出於某種原因,用戶無法連接在SQL Server 2008
時查看錶下面是我使用的創建用戶的命令。我不想讓用戶dbuser
架構的所有者。
create user dbuser for login dbuser'
--on the specific database, I am using these commands.
exec sp_addrolemember @rolename = 'db_datareader', @membername = 'dbuser'
exec sp_addrolemember @rolename = 'db_datawriter', @membername = 'dbuser'
grant select on schema :: [schema1] TO [dbuser]
grant insert on schema :: [schema1] TO [dbuser]
grant update on schema :: [schema1] TO [dbuser]
grant execute on schema :: [schema1] TO [dbuser]
grant select on schema :: [schema2] TO [dbuser]
grant insert on schema :: [schema2] TO [dbuser]
grant update on schema :: [schema2] TO [dbuser]
grant execute on schema :: [schema2] TO [dbuser]
即使我授予的模式。與dbuser
登錄時,用戶的所有插入和更新的訪問是無法從任何模式的查看任何表中。當用戶嘗試連接到數據庫時,他只會看到系統表選項卡。用戶需要看到schema1,schema2, schema3
感謝
如果您發佈的代碼,XML或數據樣本,** **請在高亮文本編輯器的線和編輯器工具欄上的漂亮格式點擊「代碼示例」按鈕('{}')並語法突出顯示它! –
感謝您爲我編輯它。我會在這裏做。 – iims