使用SQL获取TableID
查询TableID需要从SqlDictionary中查询,此表中存放了TableID和FieldID
alter procedure GetImageOfItemId @ItemId varchar(20)
as
begin
select top 1 a.itemId,
b.ACT_DesignNo,
d.image,
c.RefTableId
from inventTable a
join ACT_DesignNoTable b on a.ACT_DesignNo = b.ACT_DesignNo
join DocuRef c on c.RefRecId = b.RecId
join DocuImgs d on d.RefRecId = c.RecId
where c.RefTableId in ( select tableid
from SqlDictionary
where fieldId = 0 and
name = 'Act_DesignNoTable'
)
and a.itemid = @ItemId
end
go