locked
Maximum size for a datatype RRS feed

  • Question

  • User262367610 posted

    Hi all,

    am doing a project   in VB.net using SQL SERVER

     In my database i have column in my table with datatype varchar(8000).

     When am trying to insert more data into that column it is giving execption like :

    String or binary data would be truncated. The statement has been terminated.

     

    How to solve this.Is any way to specify the datatype with more size

    please help me

    Thanks in advance,

    Madhavi

    Thursday, June 26, 2008 3:55 AM

Answers

  • User-1399914977 posted

    Hi Rizwan,

    Here am not using a storedprocedure.

    Actually my requirement is : I have a excel sheet the data in the excel sheet has  to be inserted into the table.In that excel sheet i have one colimn with large data.At that point am getting the error

     

    Use "Text" data type, while importing data from excel sheet. That will do your job 100%

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, June 26, 2008 4:32 AM
  • User1690675763 posted

     yes using text datatype will solve your problem....we can soter huge amoun of data using text datatype.

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, June 26, 2008 4:37 AM

All replies

  • User541108374 posted

    Hi,

     you could use ntext or text.

    Grz, Kris.

    Thursday, June 26, 2008 4:00 AM
  • User-1399914977 posted

    if you want to store more then 8000 characters you have to switch to bigger data types line "Text"

    So alter your table and change the column data type to Text 

     

    Thursday, June 26, 2008 4:02 AM
  • User262367610 posted

    In ntext or text what data i can use.

    here i want to use  numbers and text and special characters in my data.

    and what the maximum length for that

    Thursday, June 26, 2008 4:05 AM
  • User1690675763 posted

     you can use text data type. have a look on length of all datatypes in sql and selet as per your requirements.

    http://www.teratrax.com/sql_guide/data_types/sql_server_data_types.html

    Thursday, June 26, 2008 4:07 AM
  • User848370396 posted

    you can store any type of data in that column, it will store upto 2^30-1 characters

    refer SQL Booksonline topic "ntext text and image"

    Thursday, June 26, 2008 4:09 AM
  • User262367610 posted

    I have altered my table i mean i have changed the datatype to text

    but still am getting the same error when am trying to insert

     

    Thursday, June 26, 2008 4:14 AM
  • User1690675763 posted

     Remember to chnage data type to ntext in table and as well as in stored procedure. as i guess you are missing to change in stored procedures

    Thursday, June 26, 2008 4:24 AM
  • User262367610 posted

    Hi Rizwan,

    Here am not using a storedprocedure.

    Actually my requirement is : I have a excel sheet the data in the excel sheet has  to be inserted into the table.In that excel sheet i have one colimn with large data.At that point am getting the error

    Thursday, June 26, 2008 4:28 AM
  • User-1399914977 posted

    Hi Rizwan,

    Here am not using a storedprocedure.

    Actually my requirement is : I have a excel sheet the data in the excel sheet has  to be inserted into the table.In that excel sheet i have one colimn with large data.At that point am getting the error

     

    Use "Text" data type, while importing data from excel sheet. That will do your job 100%

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, June 26, 2008 4:32 AM
  • User1690675763 posted

     yes using text datatype will solve your problem....we can soter huge amoun of data using text datatype.

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, June 26, 2008 4:37 AM
  • User262367610 posted

    ok thankyou

    Thursday, June 26, 2008 4:38 AM