Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Implicit conversion from data type ntext

Author  Topic 

Atena
Starting Member

1 Post

Posted - 2009-12-04 : 05:06:00
Hello.
When I try and send a
string that is over 4000 characters long from our program to the SQL Server
for a stored procedure, I always get the following error :

Implicit conversion from data type ntext to varchar is not allowed. Use the
CONVERT function to run this query.

If the string is less than 4000 characters, it goes over fine. What I am
trying to figure out is why/where the string is being converted from a
varchar to a ntext datatype. In the stored procedure, the string is expected
in a varchar(8000) format, and the string is defiend as a JAVA string on the
program side. Is it possible that the connection JDBC driver is converting the
string to ntext when over 4000 characters long?
heer is my proc:
CREATE PROCEDURE InsertData
@fileID int,
@firma VARCHAR(50),
@listzw Varchar(8000)

INSERT INTO firma ( [firma], [fileID], [list])
VALUES( @fileID , @firma , @listzw)

list has also datatyp varchar(8000)
Thanks!
   

- Advertisement -