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
 Data Type Required for Long Text

Author  Topic 

riagarwal
Starting Member

4 Posts

Posted - 2009-09-25 : 08:22:55
Dear Friends,

I have a txt which is some where around 2 pages long (around 10,000 characters) and would like to insert the same in the SQL Server 2000 database table. I have tried ntext / nvarchar (4000) but the text is being truncated.

Please suggest what could be done to insert that much amount of data in table in SQL server 2000/

Thanks
Ritesh Aggarwal
riteshaggarwal2004@gmail.com


Thanks
Ritesh

winterh
Posting Yak Master

127 Posts

Posted - 2009-09-25 : 08:49:55
try using memo, I think it is MEMO or something like that.

[ /fail at query]
Go to Top of Page

winterh
Posting Yak Master

127 Posts

Posted - 2009-09-25 : 08:52:58
Sorry, varChar(max) or Text(max)

Text(max) will allocate the most character space for you, VarChar(Max) is 8000 characters, nVarchar(max) is 4000 Characters, text(max) is in the millions of characters lol.

[ /fail at query]
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-09-25 : 09:10:39
quote:
Originally posted by winterh

try using memo, I think it is MEMO or something like that.

[ /fail at query]


MEMO is for ACCESS

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-09-25 : 09:11:10
quote:
Originally posted by winterh

Sorry, varChar(max) or Text(max)

Text(max) will allocate the most character space for you, VarChar(Max) is 8000 characters, nVarchar(max) is 4000 Characters, text(max) is in the millions of characters lol.

[ /fail at query]


These datatypes are not supported in SQL Server 2000 which OP uses

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-09-25 : 09:13:53
quote:
Originally posted by riagarwal

Dear Friends,

I have a txt which is some where around 2 pages long (around 10,000 characters) and would like to insert the same in the SQL Server 2000 database table. I have tried ntext / nvarchar (4000) but the text is being truncated.

Please suggest what could be done to insert that much amount of data in table in SQL server 2000/

Thanks
Ritesh Aggarwal
riteshaggarwal2004@gmail.com


Thanks
Ritesh


Use Text datatype

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

winterh
Posting Yak Master

127 Posts

Posted - 2009-09-25 : 09:19:14
Dang, Again. I need to start reading the questions properly.

[ /fail at query]
Go to Top of Page

winterh
Posting Yak Master

127 Posts

Posted - 2009-09-25 : 09:19:56
(But this is my first forum account, I am still being broken in)

[ /fail at query]
Go to Top of Page

winterh
Posting Yak Master

127 Posts

Posted - 2009-09-25 : 09:20:31
xD :) ;) :P

[ /fail at query]
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-09-25 : 09:21:26
quote:
Originally posted by winterh

Dang, Again. I need to start reading the questions properly.

[ /fail at query]


Ok. No problem

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

winterh
Posting Yak Master

127 Posts

Posted - 2009-09-25 : 09:25:03
Madhivanan Can you please look at my other forum posting to make sure it is correct - http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=133436

[ /fail at query]
Go to Top of Page

winterh
Posting Yak Master

127 Posts

Posted - 2009-09-25 : 09:25:21
Cheers Madhivanan :)

[ /fail at query]
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-09-25 : 09:32:20
quote:
Originally posted by winterh

Madhivanan Can you please look at my other forum posting to make sure it is correct - http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=133436

[ /fail at query]


I posted a solution there. Let us see what OP replies

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

riagarwal
Starting Member

4 Posts

Posted - 2009-09-25 : 09:40:13
Hi,

I tried VarChar / nVarchar .. but tehy max to 4000.
when i try to select text it shows up the length as 16. and the text is still truncated.

do i have any other option.



Thanks
Ritesh
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-09-25 : 09:44:24
quote:
Originally posted by riagarwal

Hi,

I tried VarChar / nVarchar .. but tehy max to 4000.
when i try to select text it shows up the length as 16. and the text is still truncated.

do i have any other option.



Thanks
Ritesh


Where did you select text?
and how did you know the text was truncated?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

riagarwal
Starting Member

4 Posts

Posted - 2009-09-25 : 09:47:30
Hi Madhivanan,

I am using Sql Server 2000 Query Analyser to insert the data.

I have created a query which inserts teh data into the SQL Server table, so I have the text to be inserted into table but only first 3 lines are inserted into the table.

Table Name: Rating
Colum Name: Comments
Colum datatype: Text length 16

Text snippet For Example:
Insert into Rating ('I put my whole text here')

Thanks
Ritesh
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-09-25 : 09:50:56
quote:
Originally posted by riagarwal

Hi Madhivanan,

I am using Sql Server 2000 Query Analyser to insert the data.

I have created a query which inserts teh data into the SQL Server table, so I have the text to be inserted into table but only first 3 lines are inserted into the table.

Table Name: Rating
Colum Name: Comments
Colum datatype: Text length 16

Text snippet For Example:
Insert into Rating ('I put my whole text here')

Thanks
Ritesh


How do you the length of text column is 16?
If you used text datatype, you can't define the size for it

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

riagarwal
Starting Member

4 Posts

Posted - 2009-09-25 : 09:55:41
thats correct.. it shows up in the design the table format..


Thanks
Ritesh
Go to Top of Page
   

- Advertisement -