• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 295
  • Last Modified:

What does this error means?

This was the error I got when I tried to change the collation settings.
will it wrk if I take the database into single user?
Msg 5030, Level 16, State 2, Line 1
The database could not be exclusively locked to perform the operation.
Msg 5072, Level 16, State 1, Line 1
ALTER DATABASE failed. The default collation of database 'mciw_sideB' cannot be set to SQL_Latin1_General_CP1250_CS_AS.

0
saratcm
Asked:
saratcm
  • 4
  • 3
3 Solutions
 
Raja Jegan RSQL Server DBA & ArchitectCommented:
You are trying to change the collation of your database and it failed because your database is in multi user mode..
Run this script to bring it to single user mode before your ALTER DATABASE statement for collation change:

use master
go
alter database ur_db_name set single_user with rollback immediate;
go
0
 
dwkorCommented:
and set it back to the multi user mode after you change the collation with:

alter database mciw_sideB set multi_user
0
 
saratcmAuthor Commented:
Hi all,
I tried it  using single user mode

Msg 5075, Level 16, State 1, Line 1
The object 'CK__ViewType__One__0C70CFB4' is dependent on database collation. The database collation cannot be changed if a schema-bound object depends on it. Remove the dependencies on the database collation and then retry the operation.
Msg 5072, Level 16, State 1, Line 1
ALTER DATABASE failed. The default collation of database 'database' cannot be set to SQL_Latin1_General_CP1250_CS_AS.

How should I find this object, will it harm if we delete that?
Is there a way to change the collation settings for the whole server?
0
Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

 
Raja Jegan RSQL Server DBA & ArchitectCommented:
>> The object 'CK__ViewType__One__0C70CFB4' is dependent on database collation.

Got it..
You have created view with SCHEMABINDING option and that's why you are facing this issue..
Drop those views ( Take a backup before that) and change the collation of your database and then recreate those views again which should work..

Thanks dwkor for reverting back the database to multi user mode which I missed out..
0
 
saratcmAuthor Commented:
Thanks rrjegan,
Why I had to change the collation settings on the dataase is, I recently did a migration frmo 2000---2005 and I just detached the 2000 database and attached it in 2005 server.
So this database collation didn't get updated. It has the same collation as it has on the old 2000 server.

So i tried even restoring the 2000 database on the 2005 server adn still the collation settings didn't get updated.

So will it happen in any migration or what is the best way to make sure it wont happen or how will those collation get updated?
0
 
saratcmAuthor Commented:
Hi rrjegan,
I didn't find any view in that database with that name 'CK_ViewType   '. Is there a way to find it from where it belongs too?
0
 
Raja Jegan RSQL Server DBA & ArchitectCommented:
Run this query to find the view name:

select OBJECT_NAME(parent_object_id)
from sys.objects
where name like 'CK__ViewType__One__0C70CFB4'
0
 
saratcmAuthor Commented:
Good
0

Featured Post

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now