Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

I would like to insert from the clipboard text with line breaks in a "varchar" column. Expand / Collapse
Author
Message
Posted Friday, October 1, 2010 6:08 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, October 1, 2010 8:52 AM
Points: 2, Visits: 6
Hi,

I would like to insert from the clipboard text with line breaks in a "varchar" column.
(eg. copy some lines , open "Enterprise Manager" select column and insert the Text from clipboard with CTRL + V )

If I do, I only have the first line in the column.


Then I thought I take the new "SQL Server Managemant Studio" and do the same (select column and insert the Text from clipboard with CTRL + V )
Hmm .. only the first line there.

I can not believe. Is ther trick to do it?

Thank you in advance for your help!

Please dont tell me: "Use MS-ACCESS to connect to the DB and INSERT it the way I want (CTRL+V)" this is the F....... Way I do it
Post #996570
Posted Friday, October 1, 2010 8:09 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 7:08 AM
Points: 12,864, Visits: 31,711
in the object explorer on the left, expand your database till you see the table.
right click on that table , and selecte the "Edit Top 200 rows;
you can always change the SQL to get the whole table, but the grid that is presented is editable, so you can select a cell and paste into it, just like the old Enterpise Manager.


Lowell

--There is no spoon, and there's no default ORDER BY in sql server either.
Actually, Common Sense is so rare, it should be considered a Superpower. --my son
Post #996660
Posted Friday, October 1, 2010 8:19 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: 2 days ago @ 9:04 AM
Points: 3,832, Visits: 4,965
the only way I know to do this is by using T-SQL,
e.g.

UPDATE TableName
SET VarcharColumn = 'Some Text with
line breaks in'
WHERE PrimaryKeyColumn = SomeValue



____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
Post #996674
Posted Friday, October 1, 2010 8:32 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, October 1, 2010 8:52 AM
Points: 2, Visits: 6
@Lowell
Yes, and if I do so and there a linebreaks in, i have only the First line

@stewartc-708166
Then i'll try the Option to connect with MS-ACCES because that works.
But its unbeliveble that i have to do so.

Post #996689
Posted Friday, October 1, 2010 9:01 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 7:08 AM
Points: 12,864, Visits: 31,711
no, whatever you paste is whatever you paste....

the GRID, by design, cannot show multiple rows...(it's a grid), so for presentation purposes, it replaces CHAR(13) and CHAR(10) as spaces...but the underlying data is still whatever you paste...
after editing, go to a new query, change to text mode(control T), and select the row with the value you pasted...it's got CrLf's in it if you pasted it. change back grid mode(control D) and you see the data with CrLf replaced with spaces.


cheese and rice, it only takes the first line of the pasted text!
sorry i was all wrong! the CrLf behavior i stated is true if the data contains it, but not the pasteing part!


Lowell

--There is no spoon, and there's no default ORDER BY in sql server either.
Actually, Common Sense is so rare, it should be considered a Superpower. --my son
Post #996744
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse