Click to See Complete Forum and Search --> : how to Concat text data type in SQL server 2000


aananthanp
September 16th, 2005, 05:04 AM
hi,
how to concade the text data type with varchar data type.

my sample segment is

here
rowdata as varchar(100) datatype
Result as text data type
.................................
Create table #tempIntraday (Result text,ErrorMsg varchar(30),Error int)

set @firstTime = 0
DECLARE crTables CURSOR FORWARD_ONLY READ_ONLY FOR select rowdata from #temptbl
OPEN crTables
fetch next from crTables into @rowdata
WHILE @@FETCH_STATUS = 0
BEGIN
if @firstTime = 0
begin
insert into #tempIntraday values (@rowdata,'',0)
end
else
begin
set @rowdata = ';' + @rowdata
update #tempIntraday set Result =Result+ @rowdata
end
set @firstTime = @firstTime + 1
fetch next from crTables into @rowdata
END
CLOSE crTables
DEALLOCATE crTables
.................................