create procedure sys.sp_objectfilegroup --- 1996/08/30 17:44
@objid int
as
/*
** Print out the object's data filegroup if applicable.
*/
if exists (select * from sysobjects
where id = @objid
and type in ('S ','U '))
begin
select Data_located_on_filegroup = d.name
from sys.data_spaces d
where d.data_space_id =
(select i.data_space_id from sys.indexes i
where i.object_id = @objid and i.index_id < 2)
end
/*
** It's not a table so segment is not applicable.
*/
else
select Data_located_on_filegroup = 'not applicable'
return (0) -- sp_objectfilegroup