Author |
Topic |
richdiaz99
Starting Member
22 Posts |
Posted - 2012-10-01 : 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! |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-10-01 : 11:05:14
|
try pasting it into notepad and then copying and pasting to SSMS editor------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
richdiaz99
Starting Member
22 Posts |
Posted - 2012-10-01 : 12:14:09
|
quote: Originally posted by visakh16 try pasting it into notepad and then copying and pasting to SSMS editor------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/
Tried that sir, it did not work :-( |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-10-01 : 12:21:39
|
where's the text coming from?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-10-01 : 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 - 2012-10-01 : 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? :-) |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-10-01 : 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 questionwhere are you getting this string from ie source?why do you need to copy and paste it manually in the first place?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
richdiaz99
Starting Member
22 Posts |
Posted - 2012-10-01 : 13:53:59
|
quote: answer the other questionwhere are you getting this string from ie source?why do you need to copy and paste it manually in the first place?SQL Server MVPhttp://visakhm.blogspot.com/
Sorry,I am pasting from the current website. |
|
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-10-01 : 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'); |
|
|
|