ssteenkiste / nettiers

Automatically exported from code.google.com/p/nettiers
1 stars 0 forks source link

SQL Server collate diferent to the databese collate, Release 3.0.1 #432

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I have a SQL server set with SQL_Latin1_General_CP1_CI_AS and a data base set 
with Modern_Spanish_CI_AS as it collate, when I try to use the SP GetTotalItems 
with varchar or nchar in the where sentence, I get an error Cannot resolve the 
collation conflict between "SQL_Latin1_General_CP1_CI_AS " and 
"Modern_Spanish_CI_AS " in the equal to operation.

this is because the GetTotalItems create a temporal table with someting like 
this

CREATE TABLE #PageIndex ( [IndexId] int IDENTITY (1, 1) NOT NULL, [E_MATNR] 
varchar(18)  , [E_WERKS] varchar(4)  , [MATNR] )

in previous version of netTier doesnt have this problem because the create is 
something like this;

CREATE TABLE #PageIndex ( [IndexId] int IDENTITY (1, 1) NOT NULL, [E_MATNR] 
varchar(18) COLLATE database_default , [E_WERKS] varchar(4) COLLATE 
database_default , [MATNR] varchar(18) COLLATE database_default ).

in this case use COLLATE database_default solve the problem.

Original issue reported on code.google.com by teodo...@gmail.com on 29 Apr 2013 at 2:05

GoogleCodeExporter commented 9 years ago
For SQL Server and nettiers 2.3.2 version it seems changing the procedure 
GetPagedHelper(ColumnSchema column) in StoredProceduresXML.cst by replacing 
"param += "(" + column.Size + ") "" by "param += "(" + column.Size + ") COLLATE 
database_default"" solves the problem. Fixed file attached if it helps.

Probably there are some more places where this needs to be changed also.

Original comment by lenli...@gmail.com on 14 Apr 2015 at 1:02

Attachments: