Let me "try" to pinpoint them. I cannot give exact line numbers because I worked them on v4b04, thus I'll rather give somehow longer code portions... Changes are marked with bold-red...
Setup.asp
[AROUND LINE 1450]
SpecialSql5(SQL7) = "CREATE TABLE " & strTablePrefix & "A_TOPICS ( "
SpecialSql5(SQL7) = SpecialSql5(SQL7) & "CAT_ID int NOT NULL , "
SpecialSql5(SQL7) = SpecialSql5(SQL7) & "FORUM_ID int NOT NULL , "
SpecialSql5(SQL7) = SpecialSql5(SQL7) & "TOPIC_ID int IDENTITY (1, 1) NOT NULL , "
SpecialSql5(SQL7) = SpecialSql5(SQL7) & "T_STATUS smallint NULL , "
SpecialSql5(SQL7) = SpecialSql5(SQL7) & "T_MAIL smallint NULL , "
SpecialSql5(SQL7) = SpecialSql5(SQL7) & "T_SUBJECT nvarchar (100) NULL , "
SpecialSql5(SQL7) = SpecialSql5(SQL7) & "T_MESSAGE ntext NULL , "
SpecialSql5(SQL7) = SpecialSql5(SQL7) & "T_AUTHOR int NULL , "
SpecialSql5(SQL7) = SpecialSql5(SQL7) & "T_REPLIES int NULL , "
SpecialSql5(SQL7) = SpecialSql5(SQL7) & "T_VIEW_COUNT int NULL , "
SpecialSql5(SQL7) = SpecialSql5(SQL7) & "T_LAST_POST varchar (14) NULL , "
SpecialSql5(SQL7) = SpecialSql5(SQL7) & "T_DATE varchar (14) NULL, "
SpecialSql5(SQL7) = SpecialSql5(SQL7) & "T_LAST_POSTER int NULL, "
SpecialSql5(SQL7) = SpecialSql5(SQL7) & "T_IP varchar (15) NULL, "
SpecialSql5(SQL7) = SpecialSql5(SQL7) & "T_LAST_POST_AUTHOR int NULL ) "
...
[AROUND LINE 1520]
SpecialSql5(SQL7) = "CREATE TABLE " & strTablePrefix & "A_REPLY ( "
SpecialSql5(SQL7) = SpecialSql5(SQL7) & "CAT_ID int NOT NULL , "
SpecialSql5(SQL7) = SpecialSql5(SQL7) & "FORUM_ID int NOT NULL , "
SpecialSql5(SQL7) = SpecialSql5(SQL7) & "TOPIC_ID int NOT NULL , "
SpecialSql5(SQL7) = SpecialSql5(SQL7) & "REPLY_ID int IDENTITY (1, 1) NOT NULL , "
SpecialSql5(SQL7) = SpecialSql5(SQL7) & "R_STATUS smallint NULL , "
SpecialSql5(SQL7) = SpecialSql5(SQL7) & "R_MAIL smallint NULL , "
SpecialSql5(SQL7) = SpecialSql5(SQL7) & "R_AUTHOR int NULL , "
SpecialSql5(SQL7) = SpecialSql5(SQL7) & "R_MESSAGE ntext NULL , "
SpecialSql5(SQL7) = SpecialSql5(SQL7) & "R_DATE varchar (14) NULL , "
SpecialSql5(SQL7) = SpecialSql5(SQL7) & "R_IP varchar (15) NULL ) "
...
[AROUND LINE 1820]
SpecialSql6(SQL7) = "CREATE TABLE " & strTablePrefix & "A_TOPICS ( "
SpecialSql6(SQL7) = SpecialSql6(SQL7) & "CAT_ID int NOT NULL , "
SpecialSql6(SQL7) = SpecialSql6(SQL7) & "FORUM_ID int NOT NULL , "
SpecialSql6(SQL7) = SpecialSql6(SQL7) & "TOPIC_ID int NOT NULL , "
SpecialSql6(SQL7) = SpecialSql6(SQL7) & "T_STATUS smallint NULL , "
SpecialSql6(SQL7) = SpecialSql6(SQL7) & "T_MAIL smallint NULL , "
SpecialSql6(SQL7) = SpecialSql6(SQL7) & "T_SUBJECT nvarchar (100) NULL , "
SpecialSql6(SQL7) = SpecialSql6(SQL7) & "T_MESSAGE ntext NULL , "
SpecialSql6(SQL7) = SpecialSql6(SQL7) & "T_AUTHOR int NULL , "
SpecialSql6(SQL7) = SpecialSql6(SQL7) & "T_REPLIES int NULL , "
SpecialSql6(SQL7) = SpecialSql6(SQL7) & "T_VIEW_COUNT int NULL , "
SpecialSql6(SQL7) = SpecialSql6(SQL7) & "T_LAST_POST varchar (14) NULL , "
SpecialSql6(SQL7) = SpecialSql6(SQL7) & "T_DATE varchar (14) NULL, "
SpecialSql6(SQL7) = SpecialSql6(SQL7) & "T_LAST_POSTER int NULL, "
SpecialSql6(SQL7) = SpecialSql6(SQL7) & "T_IP varchar (15) NULL, "
SpecialSql6(SQL7) = SpecialSql6(SQL7) & "T_LAST_POST_AUTHOR int NULL ) "
...
[AROUND LINE 1900]
SpecialSql6(SQL7) = "CREATE TABLE " & strTablePrefix & "A_REPLY ( "
SpecialSql6(SQL7) = SpecialSql6(SQL7) & "CAT_ID int NOT NULL , "
SpecialSql6(SQL7) = SpecialSql6(SQL7) & "FORUM_ID int NOT NULL , "
SpecialSql6(SQL7) = SpecialSql6(SQL7) & "TOPIC_ID int NOT NULL , "
SpecialSql6(SQL7) = SpecialSql6(SQL7) & "REPLY_ID int NOT NULL , "
SpecialSql6(SQL7) = SpecialSql6(SQL7) & "R_STATUS smallint NULL , "
SpecialSql6(SQL7) = SpecialSql6(SQL7) & "R_MAIL smallint NULL , "
SpecialSql6(SQL7) = SpecialSql6(SQL7) & "R_AUTHOR int NULL , "
SpecialSql6(SQL7) = SpecialSql6(SQL7) & "R_MESSAGE ntext NULL , "
SpecialSql6(SQL7) = SpecialSql6(SQL7) & "R_DATE varchar (14) NULL , "
SpecialSql6(SQL7) = SpecialSql6(SQL7) & "R_IP varchar (15) NULL ) "
...
[TO BE ADDED INTO NEW UPGRADE CODE]
'## Change SQL 7 T_MESSAGE, T_SUBJECT and R_MESSAGE fields to unicode versions correcting an old bug
if (strDBType = "sqlserver") and (strSQL_Server = "SQL7") then
Dim SpecialSQL12(4)
'## Change T_MESSAGE to a NTEXT in A_TOPICS table and TOPICS table
strOkMessage = fLangN(sLngSetup00520, "T_MESSAGE")
SpecialSQL12(SQL7) = "ALTER TABLE " & strTablePrefix & "A_TOPICS ALTER COLUMN T_MESSAGE NTEXT NULL "
call SpecialUpdates(SpecialSQL12, strOkMessage)
Response.Flush
SpecialSQL12(SQL7) = "ALTER TABLE " & strTablePrefix & "TOPICS ALTER COLUMN T_MESSAGE NTEXT NULL "
call SpecialUpdates(SpecialSQL12, strOkMessage)
Response.Flush
'## Change T_SUBJECT to a NVARCHAR in A_TOPICS table and TOPICS table
strOkMessage = fLangN(sLngSetup00520, "T_SUBJECT")
SpecialSQL12(SQL7) = "ALTER TABLE " & strTablePrefix & "A_TOPICS ALTER COLUMN T_SUBJECT NVARCHAR (100) NULL "
call SpecialUpdates(SpecialSQL12, strOkMessage)
Response.Flush
SpecialSQL12(SQL7) = "ALTER TABLE " & strTablePrefix & "TOPICS ALTER COLUMN T_SUBJECT NVARCHAR (100) NULL "
call SpecialUpdates(SpecialSQL12, strOkMessage)
Response.Flush
'## Change R_MESSAGE to a NTEXT in A_REPLY table and REPLY table
strOkMessage = fLangN(sLngSetup00520, "R_MESSAGE")
SpecialSQL12(SQL7) = "ALTER TABLE " & strTablePrefix & "A_REPLY ALTER COLUMN R_MESSAGE NTEXT NULL "
call SpecialUpdates(SpecialSQL12, strOkMessage)
Response.Flush
SpecialSQL12(SQL7) = "ALTER TABLE " & strTablePrefix & "REPLY ALTER COLUMN R_MESSAGE NTEXT NULL "
call SpecialUpdates(SpecialSQL12, strOkMessage)
Response.Flush
end if
In the last portion of the above code, just replace the v4 specific language elements of type
strOkMessage = fLangN(sLngSetup00520, "T_MESSAGE")
with
strOkMessage = "T_MESSAGE Field has been changed"
As you see, the problem is caused by a buggy version of inc_create_forum_mssql.asp (I cheched v3.3.05 and it has this bug), where the TOPICS and REPLY tables are created with non-unicode types. If people used that version to create the tables, the effects continue to exist...
This is all I have in v4b04 alpha code, but (read below)...
On the other hand, I fail to understand the use of NVARCHAR on some text fields like (code portion from latest inc_create_forum_mssql.asp):
strSql = "CREATE TABLE " & strTablePrefix & "REPLY ( "
strSql = strSql & "CAT_ID int NOT NULL , "
strSql = strSql & "FORUM_ID int NOT NULL , "
strSql = strSql & "TOPIC_ID int NOT NULL , "
strSql = strSql & "REPLY_ID int IDENTITY (1, 1) NOT NULL , "
strSql = strSql & "R_MAIL smallint NULL , "
strSql = strSql & "R_AUTHOR int NULL , "
strSql = strSql & "R_MESSAGE " & strN & "text NULL , "
strSql = strSql & "R_DATE " & strN & "varchar (14) NULL , "
strSql = strSql & "R_IP " & strN & "varchar (15) NULL, "
strSql = strSql & "R_STATUS smallint NULL CONSTRAINT " & strTablePrefix & "SnitzC1017 DEFAULT 0 , "
strSql = strSql & "R_LAST_EDIT " & strN & "varchar (14) NULL , "
strSql = strSql & "R_LAST_EDITBY int NULL , "
strSql = strSql & "R_SIG smallint NULL ) "
These fields are numeric only and there is no need for them to be nvarchar even in an international environment (in our current knowledge of implementations). Therefore I did NOT took any actions to correct similar issues in these fields.
BUT, there can be a risk caused by incompatibilities in TOPICS and A_TOPICS, REPLY and A_REPLY structures. Perhaps worth to examine further...