Thursday, March 22, 2012

collation conflict

Hello,
I try to run this sql:
DECLARE @.db_backup_path varchar(100)
SET @.db_backup_path = 'rightpath'
USE mydb
SET @.db_backup_path = @.db_backup_path + 'mydb'+ '.bak'
BACKUP DATABASE mydb TO DISK = @.db_backup_path WITH INIT
Got error:
1> 2> 3> 4> 5> 6> 7> 8> 9> 10> 11> 12> 13> 14> 15> 16> 17> 18> 19> 20> 21>
22> Msg 446, Level 16, State 8, Server MyServer, Line x
Cannot resolve collation conflict for concatenation operation.
What's it and how to fix? Thanks.Actually it is this line:
SET @.db_backup_path = @.db_backup_path + 'mydb'+ '.bak'
"js" <js@.someone@.hotmail.com> wrote in message
news:uMbCLn8tFHA.460@.TK2MSFTNGP15.phx.gbl...
> Hello,
> I try to run this sql:
> DECLARE @.db_backup_path varchar(100)
> SET @.db_backup_path = 'rightpath'
> USE mydb
> SET @.db_backup_path = @.db_backup_path + 'mydb'+ '.bak'
> BACKUP DATABASE mydb TO DISK = @.db_backup_path WITH INIT
> Got error:
> 1> 2> 3> 4> 5> 6> 7> 8> 9> 10> 11> 12> 13> 14> 15> 16> 17> 18> 19> 20> 21>
> 22> Msg 446, Level 16, State 8, Server MyServer, Line x
> Cannot resolve collation conflict for concatenation operation.
> What's it and how to fix? Thanks.
>
>
>|||more info:
just notice mydb is SQL_Latin1_General_Cp1_CS_AS
and master is SQL_Latin1_General_CS_AS
what's SQL_Latin1_General_Cp1_CS_AS mean? how to fix? please help.
"js" <js@.someone@.hotmail.com> wrote in message
news:ui3FIs8tFHA.256@.tk2msftngp13.phx.gbl...
> Actually it is this line:
> SET @.db_backup_path = @.db_backup_path + 'mydb'+ '.bak'
>
> "js" <js@.someone@.hotmail.com> wrote in message
> news:uMbCLn8tFHA.460@.TK2MSFTNGP15.phx.gbl...
>|||Are you sure about 'SQL_Latin1_General_CS_AS'?
This is an invalid collation name.
Anyway, look up COLLATE in Books Online.
ML

No comments:

Post a Comment