KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm creating a stored procedure which gets some parameters and in turn these parameters are sent to another stored procedure which I'm calling from openrowset but I'm getting some syntax errors. CREATE PROCEDURE UpdatePrevFYConfigData -- Add the parameters for the stored procedure here @startDate datetime, @endDate datetime, @productGroup varchar(8000) = 'All', @projectType varchar(500) = 'All', @businessUnit nvarchar(50) = 'All', @developmentLocation nvarchar(100) = 'All' AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; declare @start varchar(50) declare @end varchar(50) set @start = cast(@startDate as varchar(40)) set @end = cast(@endDate as varchar(40)) -- Insert statements for procedure here select round(avg(a.DeviationDeadline),2) as DeviationDeadline, round(avg(a.DeviationDefinition),2) as DeviationDefinition, round(avg(a.DeviationRDCosts),2) as DeviationRDCosts, round(avg(a.FunctionsAdded) + avg(a.FunctionsDeleted),2) as NotRealizedFuncs, round(avg(a.DeviationPM2000Aufwand),2) as DeviationPM200Aufwand, round(avg(b.Defect),2) as Defect into #tempTable from openrowset('SQLNCLI', 'Server=.\sqlexpress;Trusted_Connection=yes;', 'SET NOCOUNT ON;SET FMTONLY OFF;EXEC [BSC_DB].dbo.SelectScorecardGraphData '''+@start+''', '''+@end+''', '''+@productGroup+''', '''+@projectType+''', ''1'', ''0'', ''All'', ''Current'', '''+@businessUnit+''', '''+@developmentLocation+''' ') as a, openrowset('SQLNCLI', 'Server=.\sqlexpress;Trusted_Connection=yes;', 'SET NOCOUNT ON;SET FMTONLY OFF;EXEC [BSC_DB].dbo.GetSPCDefectDistri
Tags (comma-separated)
Save Edits
Cancel