# Miscellaneous > General Database Discussions >  Long text in sql server

## srdv

i have a table in sql server, i want to insert a long text for a field. that long text like a file's text.please tell me what is the data type for that field. i tired ntext and text data type but i cant insert long text values. reply me if u have answer

----------


## rmiao

Take look at writetext in books online.

----------


## vlrgee

Hai

Try to declare the Data type as "CLOB".  It will store 1 Billion upto Characters.

----------


## rmiao

Does sql server have that data type?

----------


## dba_boulderco

If this is SQL 2005, try varchar (max)

----------


## theking2

text and ntext are types with a maximum length of 2GB.

----------


## theking2

> Hai
> 
> Try to declare the Data type as "CLOB".  It will store 1 Billion upto Characters.


Would "1 Billion" be a 1 followed by 18 zeros or a 1 followed by 12 zeros here?

----------


## rmiao

That's 1g, but sql doesn't have clob data type.

----------


## theking2

A character large object (CLOB) is a text,ntext, or image in SQL parlando. So SQLServer does support CLOB it is called text (for 8 bit ascci) or ntext (for 16 bit unicode). It can store up to 2 Gigabyte of information which is 2,147,483,647 ascci characters or 1,073,741,823 unicode characters. If you'd like to store binary data there is the image type which stores up to 2,147,483,647 bytes.

hope this helps

----------


## vanaspati

try this one

Create table TextInsert 
(Text1 Text)

GO

CREATE PROCEDURE  Text_Insert (@Document as text ) AS

Insert Into TextInsert values( @Document )

GO

exec Text_Insert 'i have a table in sql server, i want to insert a long text for a field. that long text like a files text.please tell me what is the data type for that field. i tired ntext and text data type but i cant insert long text values. 
reply me if u have answeri have a table in sql server, i want to insert a long text for a field. that long text like a files text.please tell me what is the data type for that field. i tired ntext and text data type but i cant insert long text values. 
reply me if u have answeri have a table in sql server, i want to insert a long text for a field. that long text like a files text.please tell me what is the data type for that field. i tired ntext and text data type but i cant insert long text values. 
eply me if u have answeri have a table in sql server, i want to insert a long text for a field. that long text like a files text.please tell me what is the data type for that field. i tired ntext and text data type but i cant insert long text values. reply me if u have answer
i have a table in sql server, i want to insert a long text for a field. that long text like a files text.please tell me what is the data type for that field. i tired ntext and text data type but i cant insert long text values. reply me if u have answer
i have a table in sql server, i want to insert a long text for a field. that long text like a files text.please tell me what is the data type for that field. i tired ntext and text data type but i cant insert long text values. reply me if u have answer
i have a table in sql server, i want to insert a long text for a field. that long text like a files text.please tell me what is the data type for that field. i tired ntext and text data type but i cant insert long text values. reply me if u have answer
i have a table in sql server, i want to insert a long text for a field. that long text like a files text.please tell me what is the data type for that field. i tired ntext and text data type but i cant insert long text values. reply me if u have answer
'

----------

