[posted and mailed, repuesta en news, por favor]
Ricardo Lopez Celani (rlopez (AT) unisolutions (DOT) com.ar) writes:
Quote:
I need to change the COLLATE sequence on TEMPDB database, change it from
de Latin1_General to Modern_Spanish. I donīt have here the SQLServer CD
to make a Rebuildm because Iīm on a trip and the database I have is in
Modern_Spanish and the server is Latin1_General.
What can I do ?
I tried to make an ALTER DATABASE to the database in Modern_Spanish to
change it toLatin1_General but I couldnīt because there are too many
constraints with this collation.
Thanks in advance for any help.
I need to solve it in some way because Iīve a presentation tomorrow. |
The best option may be to script the database, and a build a new one
with Modern_Spanish, and the insert or bulk copy the data over. Be
careful to use some editor to remove all COLLATE clauses that references
Latin1_General.
Before you load the data, do this:
SELECT 'ALTER TABLE ' + name ' + NOCHECK CONSTRAINT ALL
FROM sysobjects WHERE xtype = 'U'
SELECT 'ALTER TABLE ' + name ' + DISABLE TRIGGER ALL
FROM sysobjects WHERE xtype = 'U'
and run the result to prevent triggers and constraints to fire. When you
are have move the data, chance NOCHECK to CHECK and DISABLE to ENABLE and
run anew.
Note that Primary-key and Unique constraints are never disabled, so if
there is data which violates uniqueness when you move it to another
collation, you run into trouble. But if you are changing from
Latin1_General to Modern_Spanish this does not sound likely. (Unless you
also change from case-sensitive to case-insensitive.)
--
Erland Sommarskog, SQL Server MVP, sommar (AT) algonet (DOT) se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp