help me out for storing more data

  • CREATE TABLE [dbo].[blogs] (

    [blog_title] [nvarchar] (500) ,

    [blog_desc_full] [varchar] (8000) ,

    [blogger_name] [nvarchar] (100) ,

    [mailid] [nvarchar] (100) ,

    [blogid] [numeric](10, 0) IDENTITY (1, 1) NOT NULL ,

    [blog_desc] [nvarchar] (125) ,

    [cat_name] [varchar] (100) ,

    [b_url] [varchar] (250) ,

    [b_date] [datetime] NULL ,

    [author] [nvarchar] (250) ,

    [approval] [char] (1)

    ) ON [PRIMARY]

    GO

    using this script i have created my blog table.

    and a procedure given below. i am using to insert data in it.

    CREATE PROCEDURE SP_BlogAdd

    @blog_title nvarchar(500),

    @blog_desc_full varchar(8000),

    @blogger_name nvarchar(100),

    @mailid nvarchar(100),

    @blog_desc nvarchar(125),

    @cat_name varchar(100),

    @b_url varchar(250),

    @author nvarchar(250)

    AS

    INSERT INTO blogs(blog_title, blog_desc_full, blogger_name, mailid, blog_desc, cat_name, b_url,author)

    VALUES(@blog_title ,@blog_desc_full ,@blogger_name,@mailid ,@blog_desc ,@cat_name ,@b_url,@author)

    GO

    now, the problem i m facing is.

    i am using varchar datatype for [blog_desc_full] [varchar] (8000).

    i want more than this size to store data in it.

    please give me some detailed code.

    i tried text datatype but i didnt succeed. how to use text datatype.

    i replaced with text datatype.but in length i couldnt type. it shows only 16.

    Please help me out.

    regards,

    ASIF

  • Asif,

    Text data type will always show 16. This is the size of the pointer to the text data. You can store a lot of text in the text data type. See BOL article "NTEXT, TEXT and IMAGE". It says:

    "text

    Variable-length non-Unicode data in the code page of the server and with a maximum length of 231-1 (2,147,483,647) characters. When the server code page uses double-byte characters, the storage is still 2,147,483,647 bytes. Depending on the character string, the storage size may be less than 2,147,483,647 bytes. "

    Your problem with your insert statement will be that you may not be able to create a local variable @blog_desc_full of the data type text to pass to the procedure.

    Regards,Yelena Varsha

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply