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 |
|
Axxib
Starting Member
6 Posts |
Posted - 2007-10-31 : 10:53:37
|
| Can someone please explain what the following function does?Use Mastergocreate function dbo.concatenate(@a1 as int) returns varchar(8000)asbegin declare @r varchar(8000) declare @b1 varchar(1000) set @r = '' declare c cursor for select Notes from heatdb..Accs where ID = @a1 open c fetch next from c into @b1 while @@FETCH_STATUS = 0 begin set @r = @r + ' ' + @b1 fetch next from c into @b1 end close c deallocate c return @rendgo |
|
|
elancaster
A very urgent SQL Yakette
1208 Posts |
Posted - 2007-10-31 : 10:58:59
|
| it goes your table 'Accs' and pulls out all the 'notes' entries for a given id (@a1), then concatenates them together into 1 string and returns it to youEm |
 |
|
|
jhocutt
Constraint Violating Yak Guru
385 Posts |
Posted - 2007-10-31 : 10:59:26
|
| Yes it contatenates values from Accs for a specified id"God does not play dice" -- Albert Einstein"Not only does God play dice, but he sometimes throws them where they cannot be seen." -- Stephen Hawking |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
|
|
Axxib
Starting Member
6 Posts |
Posted - 2007-11-01 : 08:10:17
|
| Thanks Guys |
 |
|
|
|
|
|