leveetated
Programmer
Hello experts,
I've got a UDF that should simply count the number of objects in a container. However, I cannot pass the container ID or any container info to it - only the ID of one object.
So I want the UDF to do this: Find the container it's currently in, AND do a count of ALL other objects currently in that container too. I have a view that contains the info I need.
Here's what I have so far but it simply returns the number of objects per object ID, not per container:
How can I *broaden* my count in the UDF to count all objects in the container, and not just the one object I'm passing to the UDF?
Many, many thanks in advance,
Lee.
I've got a UDF that should simply count the number of objects in a container. However, I cannot pass the container ID or any container info to it - only the ID of one object.
So I want the UDF to do this: Find the container it's currently in, AND do a count of ALL other objects currently in that container too. I have a view that contains the info I need.
Here's what I have so far but it simply returns the number of objects per object ID, not per container:
Code:
create function [dbo].[count_objsContainer](@objectid varchar(200))
returns varchar(64) as
begin
declare @str varchar(64)
select @str = count(componentid)
from objcurlocview where objectid = @objectid
return @str
end
How can I *broaden* my count in the UDF to count all objects in the container, and not just the one object I'm passing to the UDF?
Many, many thanks in advance,
Lee.