1

I have a windows 2016 server OS and a MSSQL 2017 DB.

My table is the following:

CREATE TABLE [dbo].[temp_table](
[varchar_250] [varchar](250) NULL,
[varchar_4000] [varchar](4000) NULL,
[varchar_max] [varchar](max) NULL,
[nvarchar_250] [nvarchar](250) NULL,
[nvarchar_4000] [nvarchar](4000) NULL,
[nvarchar_max] [nvarchar](max) NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

This table have one row, and all cells value is the 'őőŐŐűűŰŰööÖÖüüÜÜóóÓÓúúÚÚééÉÉááÁÁ' string.

I wrote an exe program, a simple dll program and an isapi dll program in Delphi. All program include one procedure. This procedure contains a query that read from the temp_table. After that, the procedure write the values into a txt file.

My exe program call the procedure:

  1. Direct
  2. From simple dll
  3. From isapi dll as external procedure

The result is always the following in 1-3:

column type varchar_250, value: őőŐŐűűŰŰööÖÖüüÜÜóóÓÓúúÚÚééÉÉááÁÁ

column type varchar_4000, value: őőŐŐűűŰŰööÖÖüüÜÜóóÓÓúúÚÚééÉÉááÁÁ

column type varchar_max, value: őőŐŐűűŰŰööÖÖüüÜÜóóÓÓúúÚÚééÉÉááÁÁ

column type nvarchar_250, value: őőŐŐűűŰŰööÖÖüüÜÜóóÓÓúúÚÚééÉÉááÁÁ

column type nvarchar_4000, value: őőŐŐűűŰŰööÖÖüüÜÜóóÓÓúúÚÚééÉÉááÁÁ

column type nvarchar_max, value: őőŐŐűűŰŰööÖÖüüÜÜóóÓÓúúÚÚééÉÉááÁÁ

However when I load isapi dll into browser the program make the text file, but the data is not correct:

column type varchar_250, value: őőŐŐűűŰŰööÖÖüüÜÜóóÓÓúúÚÚééÉÉááÁÁ

column type varchar_4000, value: őőŐŐűűŰŰööÖÖüüÜÜóóÓÓúúÚÚééÉÉááÁÁ

column type varchar_max, value: ooOOuuUUööÖÖüüÜÜóóÓÓúúÚÚééÉÉááÁÁ

column type nvarchar_250, value: ooOOuuUUööÖÖüüÜÜóóÓÓúúÚÚééÉÉááÁÁ

column type nvarchar_4000, value: ooOOuuUUööÖÖüüÜÜóóÓÓúúÚÚééÉÉááÁÁ

column type nvarchar_max, value: ooOOuuUUööÖÖüüÜÜóóÓÓúúÚÚééÉÉááÁÁ

In 1-3 cases the procedure is called by my user, in the last case the procedure is called by IIS.

What is the problem with the last case?

Thank you in advance for your help

tecza
  • 11
  • 3
  • You only show 2 cases and all the values are the same. – Brian Oct 24 '18 at 14:43
  • No, the second run appears to loose the double forward diacritics on the last 4 varchar types. What is missing to answer this question is more about the context: how is the procedure called from Delphi, with a stored procedure object on a data module? At least some bit of code would be a great help. – Stijn Sanders Oct 26 '18 at 18:18

1 Answers1

0

make your varchar size multiplied by 2. so for varchar(250) will become varchar(500). not sure about the internals but will fix the problem.

Ago
  • 755
  • 7
  • 28
  • Unfortunately I must used varchar(max) and nvarchar(max) types, I can not limit the length of the inputs. Anyway my problem does not exists in the following cases: os: Windows 10 home or Windows server 2008 or Windows server 2012 db: MSSQL 2008 or MSSQL 20014 I don't understand why it does not work in Windows 2016 and MSSQL 2017 or MSSQL 2014 I think the responsible is the IIS ISAPI module, but i don't know what to do. – tecza Oct 30 '18 at 15:48