查询问题,马上解贴!不够再加
CREATE PROCEDURE [dbo].[获取设备参数值]
@tableName nvarchar(100),
@id nvarchar(500)
AS
declare @s varchar(1000)
set @s = ''
select @s=@s+rtrim(name) + ',' from syscolumns where id = object_id(@tableName) and name not in
('备用代码','备注','批准是否通过')
order by colid
set @s=left(@s,len(@s)-1)
exec('select ' + @s + ' from ' + @tableName + ' where equipID in (' + @id + ')')
我现在要加一个联接,就是要通过设备equipID 号联接另一个表(equip 它的主键是equipID)的5个字段,