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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Trouble inserting with nText

Author  Topic 

mccanoe
Starting Member

4 Posts

Posted - 2006-05-24 : 17:09:46
Hi,

I have an ASP application that is having some trouble. I try to insert data and 2 of the 3 ntext fields remain empty despite my repeated attempts to insert. Here is the table definition

Create table assess
(id bigint,
Doc_Num int,
PrintOrder int,
Area nvarchar(50),
ADate datetime,
Setting nvarchar(50),
ATools nvarchar(255),
AResultAttached nvarchar(1),
AResult nText,
ABehaviour nText,
Analysis nText,
AContinue nvarchar(1),
AMove nvarchar(1))

Here is the SQL command.

INSERT INTO assess(ID, Doc_Num, PrintOrder, Area, ADate, Setting, ATools, AResultAttached, AResult, ABehaviour, Analysis)
VALUES (7001, 2, 2, 'testing', '24-May-06', 'test data', 'test data', NULL, 'test 1', 'test 2', 'test 3')

When I try to retrieve the data test 1 and test 2 are gone, but test 3 is there.

Any help would be appreciated.


Thanks,


Mike

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2006-05-24 : 17:41:06
If that is your actual code, you are using two differerent tables:

Create table assess
...
INSERT INTO IPRC_assess






CODO ERGO SUM
Go to Top of Page

mccanoe
Starting Member

4 Posts

Posted - 2006-05-24 : 18:42:37
Thanks Michael for your response. A little data entry mistake. The table names in the code were the same. I've updated my post. Thanks again.
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-05-24 : 20:48:21
i tested your codes and it works fine. No error. Record is inserted sucessfully,

"When I try to retrieve the data test 1 and test 2 are gone, but test 3 is there."
What do you mean by "gone" ? When you select back, the record with ID = 7001 is it there ?


KH

Go to Top of Page

mccanoe
Starting Member

4 Posts

Posted - 2006-05-24 : 21:54:42
Here is the weird thing. The record exists in the database correctly except the two fields AResult and ABehaviour they are empty (the first two nText fields). The third nText field fills correctly. I don't have access to the server so I can't tell you if it's NULL or just blank. I will test to find out. Otherwise there is no sign of an error the code runs as expected. Very appreciative for the help. I'm totally stressing out.
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-05-24 : 22:03:42
Is the insert is via Stored Procedure ? Try to run the insert / stored procedure in Query Analyser


KH

Go to Top of Page

mccanoe
Starting Member

4 Posts

Posted - 2006-05-25 : 10:42:59
The insert is ran using ASP. Pretty standard execute command. The code works as expected when using Access and inserting into memo fields, however the nText isn't working as expected.
Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2006-05-25 : 14:26:21
i would advice you to change your data type to varchar, thats usually a problem with text data type. You would even have more problems, when trying to insert the value into a web page, 'cause it would probably fail.

if its a large amount of data use varchar(8000)

Afrika
Go to Top of Page
   

- Advertisement -