HOLA AMIGOS DEL FORO!!! YA ME EXTRAÑABAN? Y SI, HACIA BASTANTE QUE NO MOLESTABA... BUENO, EL NUEVO PROBLEMA QUE TENGO ES QUE TRAS EL CODIGO QUE SIGUE, ME MUESTRA AL EJECUTARLO, LOS TRES RESULTADOS POR SEPARADO EN EL ANALIZADOR DE CONSULTAS, PERO YO NECESITO EJECUTAR EL MISMO DESDE EL VISUAL STUDIO Y QUE ME DEVUELVA LOS TRES RESULTADOS Y NO SOLO EL PRIMERO DE LOS TRES, ALGUIEN PUEDE AYUDARME?:
CREATE PROCEDURE SP_NUMERAL
AS
DECLARE @sSQL1 VARCHAR(1000)
DECLARE @sSQL2 VARCHAR(1000)
DECLARE @sSQL3 VARCHAR(1000)
SET @sSQL1 =
'
SELECT
COUNT(''dbo.PER.Id_Per'') AS GENERAL
FROM
dbo.ASC INNER JOIN
dbo.GRA ON dbo.ASC.Id_Gra = dbo.GRA.Id_Gra INNER JOIN
dbo.PER ON dbo.ASC.Id_Per = dbo.PER.Id_Per INNER JOIN
dbo.SITREV ON dbo.PER.Id_Rev = dbo.SITREV.Id_Rev INNER JOIN
dbo.DEST ON dbo.PER.Id_Per = dbo.DEST.Id_Per INNER JOIN
dbo.DEP ON dbo.DEST.Id_Cod_Dpcia = dbo.DEP.Id_Cod_Dpcia INNER JOIN
dbo.DATSEC ON dbo.PER.Id_Per = dbo.DATSEC.Id_Per
WHERE (dbo.ASC.ACTASC = 1) AND
(dbo.DEST.ACTDES = 1) AND
(dbo.SITREV.TIPSITREV = 1)
'
SET @sSQL2 =
'
SELECT
COUNT(''dbo.PER.Id_Per'') AS GENERAL47
FROM
dbo.ASC INNER JOIN
dbo.GRA ON dbo.ASC.Id_Gra = dbo.GRA.Id_Gra INNER JOIN
dbo.PER ON dbo.ASC.Id_Per = dbo.PER.Id_Per INNER JOIN
dbo.SITREV ON dbo.PER.Id_Rev = dbo.SITREV.Id_Rev INNER JOIN
dbo.DEST ON dbo.PER.Id_Per = dbo.DEST.Id_Per INNER JOIN
dbo.DEP ON dbo.DEST.Id_Cod_Dpcia = dbo.DEP.Id_Cod_Dpcia INNER JOIN
dbo.DATSEC ON dbo.PER.Id_Per = dbo.DATSEC.Id_Per
WHERE (dbo.ASC.ACTASC = 1) AND
(dbo.DEST.ACTDEST = 1) AND
(dbo.SITREV.TIPSITREV = 1) AND
(dbo.SITREV.Id_REV = 1)
'
SET @sSQL3 =
'
SELECT
COUNT(''dbo.PER.Id_Per'') AS GENERALCENT47
FROM
dbo.ASC INNER JOIN
dbo.GRA ON dbo.ASC.Id_Gra = dbo.GRA.Id_Gra INNER JOIN
dbo.PER ON dbo.ASC.Id_Per = dbo.PER.Id_Per INNER JOIN
dbo.SITREV ON dbo.PER.Id_Rev = dbo.SITREV.Id_Rev INNER JOIN
dbo.DEST ON dbo.PER.Id_Per = dbo.DEST.Id_Per INNER JOIN
dbo.DEP ON dbo.DEST.Id_Cod_Dpcia = dbo.DEP.Id_Cod_Dpcia INNER JOIN
dbo.DATSEC ON dbo.PER.Id_Per = dbo.DATSEC.Id_Per
WHERE (dbo.ASC.ACTASC = 1) AND
(dbo.DEST.ACTDEST = 1) AND
(dbo.SITREV.TIPSITREV = 1) AND
(dbo.SITREV.IdREV = 1) AND
(dbo.DEP.ARECORR = ''CENTRAL'')
'
EXEC (@sSQL1)
EXEC (@sSQL2)
EXEC (@sSQL3)
GO
GRACIAS!!!