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 |
|
qman
Constraint Violating Yak Guru
442 Posts |
Posted - 2009-08-06 : 10:43:01
|
| I have a function which reads a link server table and returns all rows back to me but displays as one row based on it's where clause. See Below:ALTER function [dbo].[fn_ReturnBranches](@mid varchar(3))returns varchar(8000)as begindeclare @v varchar(8000)select @v = ''select @v = @v + Orb.mib_symbol + ', ' from servername.dbname.dbo.company Orb where (Orb.home_office_symbol = @mid and Orb.status = 'Active')select @v = left(@v, len(@v)-1)return @vend Lets say that we pass '8' to this function, I know that the select statement should return 3 records thus showing something like this being returned from the function '8, 8L, 8Z'What I am getting back from the function is '8Z' only.I expect to see '8, 8L, 8Z'Am I doing somethign wrong in this function?Hope this makes sense.Thanks |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
|
qman
Constraint Violating Yak Guru
442 Posts |
Posted - 2009-08-06 : 10:55:26
|
| Great, thanks Peso! |
 |
|
|
|
|
|