Microsoft KB Archive/70868

From BetaArchive Wiki
< Microsoft KB Archive
Revision as of 18:58, 18 July 2020 by 3155ffGd (talk | contribs) (importing KB archive)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

PRSQL9103048: Using the Datalength() Function with Convert() ID Number: Q70868

1.10 OS/2 buglist1.10

Summary:

PROBLEM ID: PRSQL9103048

SYMPTOMS Using the Datalength() function in conjunction with the convert() function will return incorrect results if the convert() function uses the CHAR datatype in a local variable (@var1,@var2).

CAUSE The Datalength() function will return the combined length of the variables, instead of the length of the datatype converted to. For example, if @var1 is defined as 10 characters and @var2 is defined as 7 characters, the following statement will return a length of 17:

  Datalength(convert(char(15),@var1 + @var2))

STATUS Microsoft has confirmed this to be a problem in SQL Server version 1.10. We are researching this problem and will post new information here as it becomes available.