Cara mengatasi SQL Server Error User Group or Role Already Exists in the Current Database

Cara mengatasi SQL Server Error User Group or Role Already Exists in the Current Database

Cara mengatasi SQL Server Error User Group or Role Already Exists in the Current Database


Masalah ini saya temukan ketika telah berhasil me restore sebuah database SQL Server dan login menggunakan akun user database tersebut. Error tersebut adalah:

"Error User Group or Role Already Exists in the Current Database"

Setelah dianalisa ternyata error ini terjadi karena user yang kita restore pada saat restore database telah ada sebelumnya pada database tersebut. Solusinya adalah kita harus menjalan sebuah script sql dibawah ini.
sp_change_users_login 'AUTO_FIX', 'nama_user_database';

Setelah anda melakukan eksekusi pada sintaks diatas maka akan muncul pesan seperti dibawah ini.

The row for user 'nama_user_database' will be fixed by updating its login link to a login already in existence.
The number of orphaned users fixed by updating users was 1.
The number of orphaned users fixed by adding new logins and then updating users was 0.

Setelah ini seharusnya anda sudah bisa kembali login ke database SQL Server anda menggunakan akun tersebut.
Semoga bermanfaat.

Sumber:
https://ardalis.com/sql-server-error-user-group-or-role-already-exists-in-the-current-database

COMMENTS

Nama

Apache,4,Bisnis,1,Bisnis Online,1,Blog,10,Blogger,6,Cpanel,1,CSS,1,Database,3,Framework,1,Hacking,3,HTML,1,HTML and CSS,2,Info,2,Javascript,2,Javascript and AJAX,5,Keamanan Web,1,linux,2,Muslim,1,MySQL,3,Networking,1,Open GL,1,Optimasi Website,7,Pemrograman java,1,Pemrograman web,5,PHP,7,phpMyAdmin,1,SEO,4,SQL,2,SQL Injection,3,SQL Server,13,SQLMap,3,UMKM,2,Umroh,1,Website,1,Wordpress,4,Xampp,1,
ltr
item
Nanang Gunawan Blog: Cara mengatasi SQL Server Error User Group or Role Already Exists in the Current Database
Cara mengatasi SQL Server Error User Group or Role Already Exists in the Current Database
Cara mengatasi SQL Server Error User Group or Role Already Exists in the Current Database
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgh6e1Z2W3yzTFiqKiaevlwmNbYho52UGTm08f9H58RKkwXnEfInKoGZrRiBn-KhxHxnHG4aCSz0_i33uYSlSTAmVuuYvOv-mgrLm-MCj-ObK3dZBjMvYVa-9Ke2bZCb9LI1jt0634L9NE/s1600/Cara+mengatasi+SQL+Server+Error+User+Group+or+Role+Already+Exists+in+the+Current+Database.jpg
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgh6e1Z2W3yzTFiqKiaevlwmNbYho52UGTm08f9H58RKkwXnEfInKoGZrRiBn-KhxHxnHG4aCSz0_i33uYSlSTAmVuuYvOv-mgrLm-MCj-ObK3dZBjMvYVa-9Ke2bZCb9LI1jt0634L9NE/s72-c/Cara+mengatasi+SQL+Server+Error+User+Group+or+Role+Already+Exists+in+the+Current+Database.jpg
Nanang Gunawan Blog
https://www.nananggunawan.com/2019/01/cara-mengatasi-sql-server-error-user.html
https://www.nananggunawan.com/
https://www.nananggunawan.com/
https://www.nananggunawan.com/2019/01/cara-mengatasi-sql-server-error-user.html
true
4195327445586723627
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy Table of Content