CREATE PROCEDURE [dbo].[Proc_WeiDuTongJi]
@code VARCHAR(9)
AS
BEGIN
declare @weidu1 int,@weidu2 int,@weidu3 int,@weidu4 int,@weidu5 int
select @weidu1=0,@weidu2 =0,@weidu3 =0,@weidu4 =0,@weidu5 =0
--维度1
select @weidu1=count(0) from [Table1](nolock) where [code]=@code
--维度2
select @weidu2=count(0) from [Table2](nolock) where [code]=@code
--维度3
select @weidu3=count(0) from [Table3](nolock) where [code]=@code
--维度4
select @weidu4=count(0) from [Table4](nolock) where [code]=@code
--维度5
select @weidu5=count(0) from [Table5](nolock) where [code]=@code
select @weidu1 as 'weidu1',@weidu2 as 'weidu2',@weidu3 as 'weidu3',@weidu4 as 'weidu4',
@weidu5 as 'weidu5'
END
GO