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)
 Getting NText to work with a web page

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-05-05 : 07:51:22
David writes "I need to allow the upload of large chunks of text to a SQL7 SP4 database table from a form on a web page and subsequently post that text to another web page. Setting the column datatype to ntext gives an error when the web page tries to execute the sql code. Change it to nvarchar and all is well. I am using Data Source Name in my connection string so I think that means ODBC

Is there something special about ntext? I looked in Online books and it seems pretty complicated. Lots about SQLGetData but I could not relate it to my task

This is the cop out. What is the maximum number of characters I can use in nvarchar?

I don't suppose that's hard enough for you guys but it has me beat.

Thanks"

X002548
Not Just a Number

15586 Posts

Posted - 2003-05-05 : 10:55:55
4000 (double bytes for n datatypes).

8000 for varchar.

n is a refernece to unicode that let's you translate chars in to any language set (still beyond me, since the context of where the words fall depending of the language). So if you don't need translations skip the unicode.

Also text is a pain in that you have send and recive data in chunks, and then reassemble them.

You could do this easier yourself by having a "Comments" table, with the key of the record you retrieving, and a comments column that is varchar(8000) AND a message Id, and a Counter. Such that for a particular key, you have message 1, and it has 4 lines of 8000 bytes each. This is a simple select statement. You can then append the data together in the order it was retrieved by ordering by the counter.

Personally I wouldn't do it any other way.



Brett

8-)
Go to Top of Page
   

- Advertisement -