Ask the Expert

Problem attaching databases because of different sort orders

I am facing a problem of attaching a database from another SQL Server to my SQL Server using the stored procedure sp_attach_db in the SQL query analizer:
 sp_attach_db 'metal' , 'c:mssql7datametal_Data.MDF','c:mssql7datametal_log.lDF'
But when I execute the above procedure, I recieve the message below.
 Server: Msg 1816, Level 16, State 1, Line 1 Could not attach the database because the character set, sort order, or Unicode collation for the database differs from this server. Server: Msg 1816, Level 16, State 1, Line 1 Could not attach the database because the character set, sort order, or Unicode collation for the database differs from this server. Warning: sort order 52 in database differs from server sort order of 146. Warning: sort order 52 in database differs from server sort order of 146.
I don't know why. Please advise.

    Requires Free Membership to View

Under SQL Server 7.0 all databases must have the same sort order as that which you selected when you installed it. And it appears your servers have been installed with different sort orders. To check use sp_helpsort on each server. To fix you may need to script the objects and transform the data from server to server using DTS.

This has changed in SQL Server 2000 and now databases can have differing sort orders.

 

For More Information

This was first published in September 2002

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: