excalibur78
IS-IT--Management
I have the following I'm trying to get 7 distinct counts from 7 different tables into this temporary table in a single record.
CREATE PROCEDURE [dbo].[Test] AS
CREATE TABLE #Temp
(
UPS int,
SW int,
PCLAN1 int,
PCLAN2 int,
POS int,
SCO1 int,
SCO2 int
)
insert into [#Temp] ([UPS]) select distinct count([store #]) from [ups cutovers] where [finished] = 'True'
insert into [#Temp] ([SW]) select distinct count([store #]) from [store wiring] where [finished] = 'True'
select * from [#temp]
GO
Thanks,
David
CREATE PROCEDURE [dbo].[Test] AS
CREATE TABLE #Temp
(
UPS int,
SW int,
PCLAN1 int,
PCLAN2 int,
POS int,
SCO1 int,
SCO2 int
)
insert into [#Temp] ([UPS]) select distinct count([store #]) from [ups cutovers] where [finished] = 'True'
insert into [#Temp] ([SW]) select distinct count([store #]) from [store wiring] where [finished] = 'True'
select * from [#temp]
GO
Thanks,
David