Ms SQL fileerror 22001=String data, right truncation when I fill data into file 
Author Message
 Ms SQL fileerror 22001=String data, right truncation when I fill data into file

I created SQL script for one file with synchronizer

CREATE TABLE dbo."LC302NAK"(
   "KORISNIK" VARCHAR(2),
   "PROG" VARCHAR(10),
   "SIFRA" VARCHAR(3),
   "NAZIV" VARCHAR(50),
   "OPERTER" VARCHAR(8),
   "DATUM" DATETIME,
   CONSTRAINT "POSIFRIProgNak" PRIMARY KEY ("KORISNIK","PROG","SIFRA"))
CREATE INDEX "PONAZIVUProgNak" ON dbo."LC302NAK"("KORISNIK","PROG","NAZIV")
When I fill it with data (sequential from the file Btrieve)  I always get
the error =90
fileerror=22001=String data, right truncation
I am using cstring's for all string fields
Recently I had the same problem with selectrevord , and i solved it with
Cstrings.

                        I am using CW5.5D

            thanks for any help



Tue, 05 Oct 2004 02:48:42 GMT  
 Ms SQL fileerror 22001=String data, right truncation when I fill data into file
One of the Btrieve fields is longer than the SQL counterpart.

You'll need to use SUB() (CW) or SUBSTRING() (SQL) or the Btrieve
equivalent to trim the string to length.

HTH
Rhys

Quote:

> I created SQL script for one file with synchronizer

> CREATE TABLE dbo."LC302NAK"(
>    "KORISNIK" VARCHAR(2),
>    "PROG" VARCHAR(10),
>    "SIFRA" VARCHAR(3),
>    "NAZIV" VARCHAR(50),
>    "OPERTER" VARCHAR(8),
>    "DATUM" DATETIME,
>    CONSTRAINT "POSIFRIProgNak" PRIMARY KEY ("KORISNIK","PROG","SIFRA"))
> CREATE INDEX "PONAZIVUProgNak" ON dbo."LC302NAK"("KORISNIK","PROG","NAZIV")
> When I fill it with data (sequential from the file Btrieve)  I always get
> the error =90
> fileerror=22001=String data, right truncation
> I am using cstring's for all string fields
> Recently I had the same problem with selectrevord , and i solved it with
> Cstrings.

>                         I am using CW5.5D

>             thanks for any help



Tue, 05 Oct 2004 20:15:57 GMT  
 Ms SQL fileerror 22001=String data, right truncation when I fill data into file
Ognjen,

Quote:

> I created SQL script for one file with synchronizer

> CREATE TABLE dbo."LC302NAK"(
>    "KORISNIK" VARCHAR(2),
>    "PROG" VARCHAR(10),
>    "SIFRA" VARCHAR(3),
>    "NAZIV" VARCHAR(50),
>    "OPERTER" VARCHAR(8),
>    "DATUM" DATETIME,
>    CONSTRAINT "POSIFRIProgNak" PRIMARY KEY ("KORISNIK","PROG","SIFRA"))
> CREATE INDEX "PONAZIVUProgNak" ON dbo."LC302NAK"("KORISNIK","PROG","NAZIV")
> When I fill it with data (sequential from the file Btrieve)  I always get
> the error =90
> fileerror=22001=String data, right truncation
> I am using cstring's for all string fields
> Recently I had the same problem with selectrevord , and i solved it with
> Cstrings.

>                         I am using CW5.5D

>             thanks for any help

You don't need to write the "" in standard- SQL when defining fields,
i would write  
CREATE TABLE dbo.LC302NAK(
Quote:
>    KORISNIK VARCHAR(2),
>    PROG VARCHAR(10),  

...

i do not know if the "" do any harm...
and i do not know if MSSQL needs the "".
But if this is necessary it is one reason more to run away from
MSSQL...

BTW: is it really necessary to use so many varchars?
for example in KORISNIK VARCHAR(2) you obviously know the maximum size
of this field.

good luck

Ralf



Tue, 05 Oct 2004 21:17:02 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. MSSQL 7.0 - Cw5.0b ee - String data, right truncation (22001) Error

2. MS SQL 22001 Error ?

3. "String data, right truncation " - Clarion/SQL/view incompatibility

4. Converting data from TPS table to MS SQL 7 table getting wrong values

5. MS SQL truncation problem

6. binary data into MS-SQL server via ODBC

7. mx.DateTime, mx.ODBC.Windows, and MS SQL Server - Fractional truncation error

8. Filling listbox with data from Text or Excel file

9. Update on what happens to data to the right of the right margin

10. Read VFP data files into Clipper data files

11. I have 100 data files, I want to join them together as one data file

12. Unix Data files vs DOS data files

 

 
Powered by phpBB® Forum Software