Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ODBC error String data,Right Truncation
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00749977
Message ID:
00750187
Vues:
23
This message has been marked as a message which has helped to the initial question of the thread.
What topic is that? It may be true when you use a variable, but when you put it into a column you get the error. (warning?)

Run this code in QA:
DECLARE @var varchar(15)

SET @var = 'This is a string that is longer than 15 characters.'

IF object_id('tempdb..#testtable') IS NOT NULL DROP TABLE #testtable
CREATE TABLE #testtable
(pk		int primary key identity
,field	varchar(10)
)

INSERT INTO #testtable
(field)
VALUES ('This is a string that is longer than 15 characters.')

INSERT INTO #testtable
(field)
VALUES (@var)

SELECT * FROM #testtable
Gives these results:
Server: Msg 8152, Level 16, State 9, Line 11
String or binary data would be truncated.
The statement has been terminated.
Server: Msg 8152, Level 16, State 9, Line 15
String or binary data would be truncated.
The statement has been terminated.
pk          field      
----------- ---------- 

(0 row(s) affected)
BOb


>Bob,
>
>I was reading the sql books on-line and it says:
>
>If the data to be stored is longer than number of characters allowed,
>the data is truncated. For example, if a column is defined as char(10)
>and the value “This is a really long character string” is stored into
>the column, Microsoft® SQL Server™ truncates the character string
>to “This is a”.
>
>Maybe the column giving the error is not a Char() field. I noticed the view has the sql timestamp column in the view, but it is not updated. Maybe I will try removing that field from the view.
>
>Have you seen this error before in sql*server?
>
>Thanks,
>
>Kevin
>
>
>
>
>Its the same problem. Trying to send more characters to the column than it is defined for will spawn this error.
>
>>Hello,
>>
>>I have a user reporting an ODBC error:
>>
>>
>Connectivity error: [Microsoft][ODBC SQL Server Driver]
>>String data,right truncation
>>
>>I have seen truncation errors in Oracle (trying to out 50 characters in a 40 character field), but I have never seen this in SQL*server. I searched MSKB and Google for this error and nothing came up that fit the scenario.
>>
>>VFP6 SP5 remote view with SQL2000.
>>
>>Any ideas?
>>
>>Thanks,
>>
>>Kevin
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform