Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 paragraph in nvarchar field

Author  Topic 

slimt_slimt
Aged Yak Warrior

746 Posts

Posted - 2008-03-01 : 15:35:37
i'm having following:


create table tbl_text
(id int,
sometext nvarchar(max)
)

insert into tbl_text (id, sometext) values (1, 'I have here paragraph
and here is another one,
and another
and another')


how can i tell sql server 2005 to give use all the paragraphs within sometext field?

dataguru1971
Master Smack Fu Yak Hacker

1464 Posts

Posted - 2008-03-01 : 20:41:43
What does that mean?

provided the paragraphs do not exceed the column size...what is the problem with your syntax?



Poor planning on your part does not constitute an emergency on my part.

Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2008-03-01 : 20:48:13
use char(10) or char(13)
in .net use Environment.Newline

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
SSMS Add-in that does a few things: www.ssmstoolspack.com
Go to Top of Page

dataguru1971
Master Smack Fu Yak Hacker

1464 Posts

Posted - 2008-03-01 : 20:49:21
ahh...for the line breaks I presume...I see said the blindman. (no offense blindman)



Poor planning on your part does not constitute an emergency on my part.

Go to Top of Page

slimt_slimt
Aged Yak Warrior

746 Posts

Posted - 2008-03-02 : 03:26:20
spirit1 - thank you;
but will the server recognize the code? or will just print "char(10)" if I use it in a string?
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2008-03-02 : 07:51:28
'I have here paragraph' + char(10) +
'and here is another one,' + char(10) +
'and another' + char(10) +
'and another'

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
SSMS Add-in that does a few things: www.ssmstoolspack.com
Go to Top of Page
   

- Advertisement -