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.
Author |
Topic |
-Dman100-
Posting Yak Master
210 Posts |
Posted - 2006-07-04 : 18:18:42
|
I have the following table which I want to display the output using print.Here is my table:dbo.press_releasesheadline varchar(255)description varchar(294)content textpr_date datetimepdf varchar(255)id int primary keyUsing query analyzer I was trying the following statement to display the contents:DECLARE @pr varchar(8000)SET @pr = (SELECT headline, description, contentFROM dbo.press_releasesWHERE id = 11)print @prThanks for any help. |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-07-04 : 18:25:25
|
You have to declare one variable for each columnselect @hl = headline, @dc = description, @ct = convert(varchar(8000), content)from dbo.press_releaseswhere id = 11 KH |
|
|
-Dman100-
Posting Yak Master
210 Posts |
Posted - 2006-07-04 : 18:37:26
|
Thank you. |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-07-05 : 04:15:30
|
orIf all columns are of varchar type, thenDECLARE @pr varchar(8000)SET @pr = (SELECT headline+','+ description+','+ contentFROM dbo.press_releasesWHERE id = 11)print @prMadhivananFailing to plan is Planning to fail |
|
|
|
|
|