Advertisement
Advertisement
| 03.10.2008 at 03:55PM PDT, ID: 23230257 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: |
USE [project_management] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE PROCEDURE [projects].[spGetProjectCosts_cursor] -- parameter for project id @pId int AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; -- Declare the variables to store the values returned by FETCH. DECLARE @aId int, @aNo int -- create a cursor to find cost for distinct accounts of the project DECLARE account_cursor CURSOR LOCAL FAST_FORWARD READ_ONLY FOR SELECT DISTINCT t1.account_id, t2.account_number FROM projects.costs t1 INNER JOIN finance.accounts t2 ON t1.account_id = t2.id WHERE project_id = @pId ORDER BY t2.account_number ASC OPEN account_cursor -- Perform the first fetch and store the values in variables. -- Note: The variables are in the same order as the columns in the SELECT statement. FETCH NEXT FROM account_cursor INTO @aId, @aNo -- Check @@FETCH_STATUS to see if there are any more rows to fetch. WHILE @@FETCH_STATUS = 0 BEGIN -- Get the costs for this specific account -- I have limited the number of columns to one for EE SELECT cost_name FROM projects.costs WHERE account_id = @aId AND project_id = @pId -- This is executed as long as the previous fetch succeeds. FETCH NEXT FROM account_cursor INTO @aId, @aNo END CLOSE account_cursor DEALLOCATE account_cursor END |