CREATE proc spTest
as
begin
declare @tbl table (obj_id int, meta_name varchar(255), meta_value sql_variant )
insert into @tbl select crmMetaInfo.[id] as obj_id, [name] as meta_name, key_value as meta_value from crmMetaInfo, crmMetaKeys where (crmMetaInfo.id = 8)and(crmMetaInfo.key_id = crmMetaKeys.[id])
select * from @tbl
end