Avatar of sarika2923
sarika2923
 asked on

Need Help with Stored Procedure

Hello I need help with the stored procedure.

I need to write logic to get the data for a specific date range and Shift.

Here's the Requirement:

Parm: CTS (1 model only) + P_BLACK_41 (1 color only) + date range (start-end) + 1 (1 shift only)   OR

Parm: ALL (all models) + all (all colors) + date range (start-end) + all (all shifts) OR

Parm: model (1 model only) + color (1 color only) + Number of Vehicles + shift   (1 shift only)   OR

Parm: all (all models) + all (all colors) + Number of Vehicles + (all shifts)  

I dont know how i can share the existing stored procedure with you

Please help me.

Thanks,
Siri
Microsoft SQL Server 2008Microsoft SQL Server

Avatar of undefined
Last Comment
David Todd

8/22/2022 - Mon
sarika2923

ASKER
Hello,

I need help with the attached stored procedure,

All i need is a logic to get the data as per the requirement listed above.

Please help me.

Thanks,
Sarika
S.txt
Lowfatspread

the detail and assistance you require should be sought from the designer of the system...
go and ask the analyst who specified the requirement for this procedure to assist in the detail of what is required....

ask to see the specification,...


specifically you need to know ]
which tables the shift is derived from
which tables the date range is to be applied to ...

the procedure should be amended to include more comments on it intended function and how it basically operates...

an example(s) of input and output  in the description would also prove useful for future maintenance/troubleshooting efforts...
sarika2923

ASKER
The Shift comes from DIM_CALENDER Table.
The Date ranges apply to Fact.Atrbt_Proprt Table and Fact_Trackg_Procs_Area.

The stored procedure should return the data, for 11 columns listed in the attached Excel sheet as per the following filtering criteria.

Parm: model (1 model only) + color (1 color only) + date range (start-end) + shift (1 shift only)   OR
Parm: model (1 model only) + color (1 color only) + Number of Vehicles + shift   (1 shift only)
123.xlsx
Your help has saved me hundreds of hours of internet surfing.
fblack61
David Todd

Hi,

In SSMS navigate to the procedure and Right click and select Script Stored Procedure as Create ...

That is, Databases | <Your Database> | Programmability | Stored Procedures

Paste the results here.

HTH
  David
sarika2923

ASKER
Hello, I got this issue resolved

Thanks,
Sarika
ASKER CERTIFIED SOLUTION
David Todd

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.