SQL Server Performance

Insert long text into table

Discussion in 'General DBA Questions' started by jilia, Apr 24, 2007.

  1. jilia New Member

    Hello all,

    I have a problem in inserting a text string of about 2000 characters.
    I supposed that I will make a column , nvarchar(4000) and in there I would insert the string .
    If I try to copy-paste the string (via the sql enterprise manager), it doesn't let do it, and if I try to write chars into the field , at about 1020 char, it stops writing..

    Why is this happening ??
    Can anyone help me about text input into tables??
  2. MohammedU New Member

    Can you please post the code...


    MohammedU.
    Moderator
    SQL-Server-Performance.com

    All postings are provided “AS IS” with no warranties for accuracy.
  3. Chappy New Member

    Dont use enterprise manager to edit data, its bad in virtually every way possible <img src='/community/emoticons/emotion-1.gif' alt=':)' /><br /><br />Use query analyser to do the insert, and if that fails then post the full query and error message
  4. jilia New Member

    This is the insert query I run from query analyzer. But insert only 256 chars... and the Table1 has a Column1 which is nvarchar(4000)....

    insert into Table1 (Column1) values ('I have a problem in inserting a text string of about 2000 characters.I supposed that I will make a column , nvarchar(4000) and in there I would insert the string .If I try to copy-paste the string (via the sql enterprise manager), it doesnt let do it, and if I try to write chars into the field , at about 1020 char, it stops writing..I have a problem in inserting a text string of about 2000 characters.I supposed that I will make a column , nvarchar(4000) and in there I would insert the string .If I try to copy-paste the string (via the sql enterprise manager), it doesnt let do it, and if I try to write chars into the field , at about 1020 char, it stops writing..I have a problem in inserting a text string of about 2000 characters.I supposed that I will make a column , nvarchar(4000) and in there I would insert the string .If I try to copy-paste the string (via the sql enterprise manager), it doesnt let do it, and if I try to write chars into the field , at about 1020 char, it stops writing..I have a problem in inserting a text string of about 2000 characters.I supposed that I will make a column , nvarchar(4000) and in there I would insert the string .If I try to copy-paste the string (via the sql enterprise manager), it doesnt let do it, and if I try to write chars into the field , at about 1020 char, it stops writing..I have a problem in inserting a text string of about 2000 characters.I supposed that I will make a column , nvarchar(4000) and in there I would insert the string .If I try to copy-paste the string (via the sql enterprise manager), it doesnt let do it, and if I try to write chars into the field , at about 1020 char, it stops writing..I have a problem in inserting a text string of about 2000 characters.I supposed that I will make a column , nvarchar(4000) and in there I would ')
  5. jilia New Member

    Sorry, I have made a mistake.. I am so silly... When I copy the results from query analyzer (copy/paste) it copies 256 chars... But in the table (as I see it from enterprise manager) I see that all the 2682 chars have been inserted...
  6. techbabu303 New Member

    It happens to all of yes ....part of learning.

    Cheers
    Sat
  7. satya Moderator

    256 is by default to the buffer length on QA, so as suggested use WRITETEXT to update or insert TEXT based columns in a table.

    Satya SKJ
    Microsoft SQL Server MVP
    Writer, Contributing Editor & Moderator
    http://www.SQL-Server-Performance.Com
    This posting is provided AS IS with no rights for the sake of knowledge sharing. The greatest discovery of my generation is that a human being can alter his life by altering his attitudes of mind.
  8. jilia New Member

    Well, I used:<br /><br /><b>Insert into table (column) values ('&lt;Here the text with about 3500 chars&gt;')</b><br /><br />and it worked fine. <br /><br />What I meant about the 256 chars, is that if you do:<br /><b>Select column from table </b><br /><br />the QA will return the column data.OK. If you copy (from the result pane) the data , and paste it into notepad(for example) you will only get 256 chars...<br /><br />I hope the above make some sense to you... <img src='/community/emoticons/emotion-1.gif' alt=':)' />
  9. Chappy New Member

    Not sure about that <img src='/community/emoticons/emotion-1.gif' alt=':)' /><br /><br />QA has a limit on the amount of text it will display for any given column, which defaults to 256 I think. <br />You can go into Query Analyser -&gt; Tools -&gt; Options -&gt; results and make this longer if you want, then all results will use the new setting<br /><br />
  10. Adriaan New Member

    ... with a maximum of 8192 characters.
  11. jilia New Member

    Thanx a lot guys.. Got it!

Share This Page