Click here to Skip to main content
15,905,967 members
Please Sign up or sign in to vote.
3.33/5 (3 votes)
Hi all,

I am using Sql Server 2005.
I have a varchar field in a table in which I want to insert some text with line feed using sql Insert statement.
The result is updated but it shows a space where ever I try to insert the line feed character char(13).

Below is the sample code that I am trying for R&D:

SQL
create table #tab1
(
a varchar(10)
)
Insert Into #tab1
select 'a' + char(13) + 'b';

select * from #tab1
drop table #tab1


Though it looks fine when I view the results in Text but in Grid results it shows a space.

Does anybody have a solution to this?

Thanks in advance,

Gopal
Posted
Comments
RDBurmon 19-Apr-11 3:32am    
Grid doesn't show your line feed. try this on your appicatin you should get the line feed in the same
gopalgupta 19-Apr-11 7:19am    
correct ..... thnx buddy

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900