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 |
|
iswan
Starting Member
28 Posts |
Posted - 2007-06-15 : 05:09:45
|
| I have a dowt in below code. When i print the '@FieldStr'. It is coming correctly. But '@FieldStr1' it is not coming correctlydeclare @FieldStr varchar(5000)declare @FieldStr1 varchar(5000)select @FieldStr=Coalesce(@FieldStr + ',','')+a.fieldname,@FieldStr1=Coalesce(@FieldStr1 + ',','')+ case when b.fieldtype = 2 then convert(varchar,b.fld_int) whenb.fieldtype = 3 then CONVERT(VARCHAR,b.fld_date,101)when b.fieldtype = 1 or b.fieldtype = 5 orb.fieldtype = 7 or b.fieldtype = 9 orb.fieldtype = 10 then b.fld_varchar end --as 'data' from sctabfieldmaster a,ProjectFormData b where a.TmplFldID=b.templatefieldid and b.ProjectID=592and b.levelid='1.1.9' and b.level2id=17print @FieldStrprint @FieldStr1 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-06-15 : 05:25:18
|
quote: Originally posted by iswan I have a dowt in below code. When i print the '@FieldStr'. It is coming correctly. But '@FieldStr1' it is not coming correctlydeclare @FieldStr varchar(5000)declare @FieldStr1 varchar(5000)select @FieldStr=Coalesce(@FieldStr + ',','')+a.fieldname,@FieldStr1=Coalesce(@FieldStr1 + ',','')+ case when b.fieldtype = 2 then convert(varchar,b.fld_int) whenb.fieldtype = 3 then CONVERT(VARCHAR,b.fld_date,101)when b.fieldtype = 1 or b.fieldtype = 5 orb.fieldtype = 7 or b.fieldtype = 9 orb.fieldtype = 10 then b.fld_varchar else '' end --as 'data' from sctabfieldmaster a,ProjectFormData b where a.TmplFldID=b.templatefieldid and b.ProjectID=592and b.levelid='1.1.9' and b.level2id=17print @FieldStrprint @FieldStr1
Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
|
|
|
|
|