Web Analytics Made Easy - Statcounter

How to change the database collation

To change the collation of an database following commands can be used:

ALTER DATABASE [database name] SET SINGLE_USER WITH ROLLBACK IMMEDIATE
ALTER DATABASE  [database name]  COLLATE Newcollation
ALTER DATABASE  [database name]  SET MULTI_USER
For example , suppose if the name of your database is learningdb and you want to change the collation to the collation SQL_Latin1_General_CP1257_CI_AS, then following commands can be used:-
ALTER DATABASE 
learningdb  SET SINGLE_USER WITH ROLLBACKIMMEDIATE
ALTER DATABASE 
learningdb  COLLATE SQL_Latin1_General_CP1257_CI_AS
ALTER DATABASE 
learningdb  SET MULTI_USER


Discover more from Technology with Vivek Johari

Subscribe to get the latest posts sent to your email.

Leave a Reply

Discover more from Technology with Vivek Johari

Subscribe now to keep reading and get access to the full archive.

Continue reading