SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Text with HardReturns,How to Paste in MSSQL Edit?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

richdiaz99
Starting Member

22 Posts

Posted - 10/01/2012 :  11:01:31  Show Profile  Reply with Quote
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
52317 Posts

Posted - 10/01/2012 :  11:05:14  Show Profile  Reply with Quote
try pasting it into notepad and then copying and pasting to SSMS editor

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

richdiaz99
Starting Member

22 Posts

Posted - 10/01/2012 :  12:14:09  Show Profile  Reply with Quote
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 :-(
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 10/01/2012 :  12:21:39  Show Profile  Reply with Quote
where's the text coming from?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

sunitabeck
Flowing Fount of Yak Knowledge

5155 Posts

Posted - 10/01/2012 :  12:28:56  Show Profile  Reply with Quote
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
Go to Top of Page

richdiaz99
Starting Member

22 Posts

Posted - 10/01/2012 :  13:46:52  Show Profile  Reply with Quote
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
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 10/01/2012 :  13:48:00  Show Profile  Reply with Quote
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/

Go to Top of Page

richdiaz99
Starting Member

22 Posts

Posted - 10/01/2012 :  13:53:59  Show Profile  Reply with Quote
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.
Go to Top of Page

sunitabeck
Flowing Fount of Yak Knowledge

5155 Posts

Posted - 10/01/2012 :  14:31:47  Show Profile  Reply with Quote
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');
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000