0% found this document useful (0 votes)
21 views1 page

Database Recollation

The document discusses running scripts to re-collate databases and tables after changing the default collation at the database level. It provides the T-SQL used to generate re-collation scripts for specific databases, notes that the index rebuilds took a long time, and recommends running the scripts twice to ensure everything is recollated properly. It also describes how text columns require being dropped and recreated manually.

Uploaded by

hanuman sqlboy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views1 page

Database Recollation

The document discusses running scripts to re-collate databases and tables after changing the default collation at the database level. It provides the T-SQL used to generate re-collation scripts for specific databases, notes that the index rebuilds took a long time, and recommends running the scripts twice to ensure everything is recollated properly. It also describes how text columns require being dropped and recreated manually.

Uploaded by

hanuman sqlboy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

Not sure what happended here or how you did the recollation.

Did you run an


existing script, or did you generate a new one? There were some in PGAS and a lot
in QFCPGAS that carried the wrong collation. You cannot just change the default
collation at the database level.

I ran the following in the PGAS and QFCPGAS databases to generate re-collation
scripts, then (carefully) ran the results. The index rebuilds in PGAS took a long
time to complete.

Use <dbname>

Go

Exec sp_recollate_database @collation = ‘Latin1_General_BIN’

Go

Also, whenever I do this, I always run it again after it completes. If the proc
doesn’t come back and say something like “No objects require recollation”, it may
need to be run again. Also, just be aware, after dropping all the Fkeys, indexes,
Pkeys, etc., the guts of the generated script is to do an ALTER TABLE ALTER COLUMN
on every single char/varchar column to change the collation. Columns using the text
datatype (there are a few) cannot be altered. For these, that table needs to be
dropped/re-created manually. For these, I use EXEC sp_tus <tablename>. You can just
run its output.

Glen
N:\Database_Admin\Knowledge_Base_for_DBA_Info\SQL Server\Database Collation Change

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy