| Author |
Topic  |
|
|
richdiaz99
Starting Member
22 Posts |
Posted - 10/01/2012 : 11:01:31
|
I am trying to paste into the SQL 2008 Editor and the paste of the large amount of text stops at the first carriage return.
Any suggestions on getting the text with the hard-returns into the column?
From what I've read so far is to make the field [nvarchar](max)
(Or maybe how to Paste/Store RichText? HTML?)
Thanks! |
Edited by - richdiaz99 on 10/01/2012 11:04:15
|
|
|
visakh16
Very Important crosS Applying yaK Herder
India
48012 Posts |
Posted - 10/01/2012 : 11:05:14
|
try pasting it into notepad and then copying and pasting to SSMS editor
------------------------------------------------------------------------------------------------------ SQL Server MVP http://visakhm.blogspot.com/
|
 |
|
|
richdiaz99
Starting Member
22 Posts |
Posted - 10/01/2012 : 12:14:09
|
quote: Originally posted by visakh16
try pasting it into notepad and then copying and pasting to SSMS editor
------------------------------------------------------------------------------------------------------ SQL Server MVP http://visakhm.blogspot.com/
Tried that sir, it did not work :-( |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
India
48012 Posts |
Posted - 10/01/2012 : 12:21:39
|
where's the text coming from?
------------------------------------------------------------------------------------------------------ SQL Server MVP http://visakhm.blogspot.com/
|
 |
|
|
sunitabeck
Flowing Fount of Yak Knowledge
5152 Posts |
Posted - 10/01/2012 : 12:28:56
|
Instead of using the editor, use a query window. In the query window, type this:
INSERT INTO YourTableNameHere (colNameHere) VALUES ('Pastethetexthere');For importing data from a file into a table, there are many other methods - for example, you can use Import/Export Wizard which can be launched by right-clicking on the database name in the object explorer in SSMS and selecting Tasks->Import data |
 |
|
|
richdiaz99
Starting Member
22 Posts |
Posted - 10/01/2012 : 13:46:52
|
quote: Originally posted by sunitabeck
Instead of using the editor, use a query window. In the query window, type this:
INSERT INTO YourTableNameHere (colNameHere) VALUES ('Pastethetexthere');
ah, this is close but the single quotes in my text break this. Guess I would have to escape these quotes with a global replace? :-) |
Edited by - richdiaz99 on 10/01/2012 13:52:35 |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
India
48012 Posts |
Posted - 10/01/2012 : 13:48:00
|
quote: Originally posted by richdiaz99
quote: Originally posted by sunitabeck
Instead of using the editor, use a query window. In the query window, type this:
INSERT INTO YourTableNameHere (colNameHere) VALUES ('Pastethetexthere');
ah, this is close but the single and double quotes in my text break this. Guess I would have to escape these quotes?
you still didnt answer the other question
where are you getting this string from ie source? why do you need to copy and paste it manually in the first place?
------------------------------------------------------------------------------------------------------ SQL Server MVP http://visakhm.blogspot.com/
|
 |
|
|
richdiaz99
Starting Member
22 Posts |
Posted - 10/01/2012 : 13:53:59
|
quote: answer the other question
where are you getting this string from ie source? why do you need to copy and paste it manually in the first place?
SQL Server MVP http://visakhm.blogspot.com/
Sorry,
I am pasting from the current website. |
 |
|
|
sunitabeck
Flowing Fount of Yak Knowledge
5152 Posts |
Posted - 10/01/2012 : 14:31:47
|
quote: ah, this is close but the single quotes in my text break this. Guess I would have to escape these quotes with a global replace? :-)
Yes, single quotes can be escaped using another quote. For example:INSERT INTO YourTableNameHere (colNameHere) VALUES ('Macy''s and Kohl''s are both in the S&P 500');
|
 |
|
| |
Topic  |
|