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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 print in next line

Author  Topic 

js.reddy
Yak Posting Veteran

80 Posts

Posted - 2008-02-22 : 07:37:48
I have a small issue.

print 'Welcome ' +'India'
output : Welcome India


But I want to display the output as
Welcome
India

can any help me!

Thanks & Regards
Js.Reddy

ayamas
Aged Yak Warrior

552 Posts

Posted - 2008-02-22 : 07:55:56
I guess

print 'Welcome '
print 'India'

Else

print 'Welcome '+ char(13) +'India'
Go to Top of Page

js.reddy
Yak Posting Veteran

80 Posts

Posted - 2008-02-22 : 07:59:07

No ayamas.
I need to do this by single query only.

quote:
Originally posted by ayamas

I guess
print 'Welcome '
print 'India'

Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-02-22 : 08:05:31
print 'Welcome' + char(13) + 'India'


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-02-22 : 08:07:28
Try:-
Print 'Welcome '+ char(13) +'India'

or
Print 'Welcome '+ char(10) +'India'
Go to Top of Page

js.reddy
Yak Posting Veteran

80 Posts

Posted - 2008-02-22 : 08:08:54

Thank you khtan

quote:
Originally posted by khtan

print 'Welcome' + char(13) + 'India'


KH
[spoiler]Time is always against us[/spoiler]



Go to Top of Page

js.reddy
Yak Posting Veteran

80 Posts

Posted - 2008-02-22 : 08:09:34
Thank you visakh

quote:
Originally posted by visakh16

Try:-
Print 'Welcome '+ char(13) +'India'

or
Print 'Welcome '+ char(10) +'India'

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-02-22 : 08:18:09
Note that in QA you need to set text mode to display on seperate line

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

js.reddy
Yak Posting Veteran

80 Posts

Posted - 2008-02-22 : 08:28:52

I think no need to set text mode if is use print command

quote:
Originally posted by madhivanan

Note that in QA you need to set text mode to display on seperate line

Madhivanan

Failing to plan is Planning to fail

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-02-22 : 08:46:03
quote:
Originally posted by js.reddy


I think no need to set text mode if is use print command

quote:
Originally posted by madhivanan

Note that in QA you need to set text mode to display on seperate line

Madhivanan

Failing to plan is Planning to fail




Yes it is. If you use variable then you need to.

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -