Mark Kadlec
Mark Kadlec

Reputation: 8450

Get carriage returns and tabs into buffer from database row

This one has me stumped.

I have a database column that stores a message body that containing tabs and carriage returns. I want to take that value and store it in another database by using cut and paste.

When I do a select on the row I want and use ctrl-c, ctrl-v into the other database insert statement, the value gets put into the new table minus the carriage returns and tabs.

There must be a simple way to preserve those characters, any help would be appreciated!

Upvotes: 0

Views: 70

Answers (1)

Mark Kadlec
Mark Kadlec

Reputation: 8450

Ok, finally figured it out!

First, in SQL Management Studio, went to Tools->Options->Query Results and changed the output from 256k to a much higher figure to prevent truncation.

Then I did output to file (versus to grid), then opened up the file in a text editor and voila! All special characters are preserved (and you can copy to the buffer).

Not sure if this is the best solution since it is very hacky, but works nonetheless!

Upvotes: 1

Related Questions