Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Different Collations

Author  Topic 

X002548
Not Just a Number

15586 Posts

Posted - 2004-06-10 : 11:45:59
OK, I'm a turned around (again...so what else is new)

Dealing with our newly outsousrced HR IT department (it got pretty bloody when that happened).

SQL 7

Now I'm dealing with the mess the old IT staff left...same database on different boxes, different sort orders (52 and 53)

How is this possible? I thought the only way was to script it and dump and load it.

Am I missing the boat (what again?)

To top it off, I'm reading this..

http://www.itworld.com/AppDev/136/ITW3856/pfindex.html

Which say in 2k you can have a dtabase (or parts of one) that run under a different sort order...

I kinda get that (why is another story)

But you can't RESTORE a different order to a box in 2k...right?

I'm so confused.

So here's the question. sql 7.0, sort order 53, database needs to be restored to a different box, sort order 52. Possible?

I didn't think so.


Brett

8-)

SamC
White Water Yakist

3467 Posts

Posted - 2004-06-10 : 12:51:48
Step 1: Margarita mix...
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2004-06-10 : 13:27:49
quote:
Originally posted by SamC

Step 1: Margarita mix...



Thanks I got that one covered...

tall glass, fill with ice, fill with tequila, stir with finger, big gulp to make room for mix, pour in mix, stir again

So....am I correct, (because I've seen it not work) that you can't do this?



Brett

8-)
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-06-10 : 13:32:12
I haven't had to restore a database with a different sort order since 6.5. In 6.5 you had to transfer the data in order to move it. You could rebuildm the master database on the server with sort order 53, then move the database with backup/restore. I'll keep looking for the answer though.

Tara
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-06-10 : 13:35:04
Looks like you can in SQL 2000:


quote:

SQL Server 2000 finally solved the problem of taking database backups from servers with a different character set / sort order and restoring them, without getting a collation error. Before SQL Server 2000, backups from one server could only be restored on a different server if the same character set and sort order where used by both servers. With SQL Server 2000, you are able to set the collating sequence at the server, database, and even the column level. Now that you can have multiple collating sequences on a single database server, there are a few things you should understand about mixing collations.




Quote taken from http://www.databasejournal.com/features/mssql/article.php/1587631



Tara
Go to Top of Page

mcrowley
Aged Yak Warrior

771 Posts

Posted - 2004-06-10 : 14:03:51
I have restored a backup from a case sensitive server to a case insensitive server. All in SQL 2k. The worst thing you will potentially have to deal with is if you have any cross-database queries that compare values. For those, you will have to specify the collation. Ugly, but there it is.
I can understand the need to have the very few case sensitive databases on the same servers with the case insensitive ones. We only had one case sensitive database, and it was always a waste to have it on a server to itself.
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2004-06-10 : 14:56:44
Yeah that's what I've been getting a sense of...unfortunatly this is 7.

But You know when soemone tells you something, and it doesn't make sense...

Sounds like this is the case...

Or as Dutch said...trust but verify

So, now, although it's like pulling teeth with these 3rd party vendors...they HAVE to execute my sp_helpsort scripts...

On both boxes...

damn it...

And the articles says you can do it on 2k...but beware...oh great, like I'm gonna want to do that...



if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[myTable99]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[myTable99]
GO

CREATE TABLE myTable99(Col1 varchar(8000))
GO

SET NOCOUNT ON
DECLARE @Error int, @RowCount int, @cmd varchar(8000), @pwd varchar(30), @uid varchar(30), @db sysname, @fn sysname

SELECT @db = db_name()
, @uid = 'sa'
, @pwd = 'p99edward'
, @fn = 'c:\myTable99_'+REPLACE(@@SERVERNAME,'\','_')+'_'+@db+'.txt'

INSERT INTO myTable99(Col1) EXEC sp_helpsort

SELECT @Error = @@ERROR, @RowCount = @RowCount

IF @Error <> 0
BEGIN
SELECT 'Error Occured executing sp_helpsort. Error='+CONVERT(varchar(5),@Error)
GOTO l_Error
END
IF @RowCount = 0
BEGIN
SELECT 'No Rows returned from sp_helpsort'
GOTO l_Error
END

SELECT @cmd = 'bcp ' + @db + '.dbo.myTable99 out ' + @fn +' -c -S' + @@SERVERNAME + ' -U'+@uid+' -P'+@pwd
SELECT @cmd

EXEC master..xp_cmdshell @cmd

SELECT * FROM myTable99
SELECT 'Successful'
GOTO l_Exit

l_Error:
SELECT 'Unsuccessful'

l_Exit:
SET NOCOUNT OFF
GO

DROP TABLE myTable99
GO



Brett

8-)
Go to Top of Page
   

- Advertisement -