在varchar(200)列的Sql Server管理工作室2008“编辑前200行”窗口中粘贴带有换行符的文本

时间:2022-07-31 00:59:18

I have to manually edit a few records in the (SQL 2008) database.

我必须手动编辑(SQL 2008)数据库中的一些记录。

I open up SSMS, rightclick on the table, choose 'edit top 200 rows', locate the right record and column, paste my text (which is something like this, bold only for presentation):

我打开SSMS,右键单击表格,选择“编辑前200行”,找到正确的记录和列,粘贴我的文本(这是类似的,粗体仅用于演示):

Hi Michel,

嗨米歇尔,

Congratulations!

恭喜!

John

约翰

And all that is stored is 'Hi Michel,'

所有存储的都是'Hi Michel'。

all the lines but the first are 'lost'.

所有的线,但第一个是'丢失'。

Is there a nice feature to paste the ENTIRE text in the field?

是否有一个很好的功能来粘贴现场的整个文本?

2 个解决方案

#1


10  

I'm not aware of a way to do this manually so i think your stuck with writing SQL. For that as your editing records you could write it as an update statement.

我不知道手动执行此操作的方法,所以我认为你坚持编写SQL。对于您的编辑记录,您可以将其写为更新语句。

String literals can span multiple lines, so you should be able to paste your updated in without reformatting it.

字符串文字可以跨越多行,因此您应该能够粘贴更新的内容而无需重新格式化。

e.g.

例如

UPDATE your_table
SET field_to_update = 'Hi Michel,

Congratulations!

John'
WHERE field = criteria_to_match

#2


4  

You'd be better working in script. You can just write an update:

你最好用脚本工作。你可以写一个更新:

UPDATE <Table Name>
SET Column = 'Hi Michel,

Congratulations!

John'
WHERE <Key column conditions>

I don't believe there's any way to do this via the Edit pane.

我不相信有任何方法可以通过“编辑”窗格执行此操作。

#1


10  

I'm not aware of a way to do this manually so i think your stuck with writing SQL. For that as your editing records you could write it as an update statement.

我不知道手动执行此操作的方法,所以我认为你坚持编写SQL。对于您的编辑记录,您可以将其写为更新语句。

String literals can span multiple lines, so you should be able to paste your updated in without reformatting it.

字符串文字可以跨越多行,因此您应该能够粘贴更新的内容而无需重新格式化。

e.g.

例如

UPDATE your_table
SET field_to_update = 'Hi Michel,

Congratulations!

John'
WHERE field = criteria_to_match

#2


4  

You'd be better working in script. You can just write an update:

你最好用脚本工作。你可以写一个更新:

UPDATE <Table Name>
SET Column = 'Hi Michel,

Congratulations!

John'
WHERE <Key column conditions>

I don't believe there's any way to do this via the Edit pane.

我不相信有任何方法可以通过“编辑”窗格执行此操作。