Trying to download v4


It would help a bit if the main project page could indicate that the v4 download is NOT available on the nice big purple button! Either a link in the text under the button to the latest v4 download, or the download contains both would be good too!

It's disconcerting when what says it is 'v3 and v4' is not: took a bit of trawling about to see why I couldn't run it, and where v4 was.

Apart from that, looking like an excellent tool! One thing to think of addi ng, is that the function SUSER_NAME() is not supported. No biggie.

Thanks -


ghytred wrote Mar 17, 2014 at 2:58 PM

PS For those looking for it, it's on the downloads page among the older versions: scroll down until you see the latest v4 download.

ghuey wrote Mar 19, 2014 at 5:43 PM


Sorry that v4 was so hard to find. I don't know if there is anything that I can do, but if there is, I will take action.

In regards to SUSER_NAME(), I do look for it. If you look in the NotSupportedByAzureFile.Config file, you should see:
    <NotSupported Text="SUSER_NAME\(" ReplaceWith="" SeverityLevel="2" ReplaceString="false" DisplayWarning="true" DefaultMessage="true" WarningMessage="" />
which is the rule that checks for SUSER_NAME. So, if this was missed in your script, then I must have something wrong with my REGEX search string. Can you send me a small snippet of TSQL that has SUSER_NAME that I missed so I can test against it?


ghytred wrote Mar 20, 2014 at 11:44 AM

Here's he script for the SP. It does include a comment which says it won't work!
--~ StoredProcedure [ops].[CalculateParent] -- SUSER_NAME( is not supported in current version of SQL Azure
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[ops].[CalculateParent]') AND type in (N'P', N'PC'))
EXEC dbo.sp_executesql @statement = N'-- Batch submitted through debugger: SQLQuery4.sql|7|0|C:\Users\RCLADM~1\AppData\Local\Temp\2\~vsE6EE.sql

CREATE PROCEDURE [ops].[CalculateParent]
    -- Add the parameters for the stored procedure here
    @childElementId int, @startUtc DateTime, @endUtc DateTime
    -- SET NOCOUNT ON added to prevent extra result sets from
    -- interfering with SELECT statements.

    exec ops.FillInMissingEPValues @startUtc, @endUtc

    declare @parentId int;
    select @parentId = isnull(SummationParentId, 0)
    from config.StructureElement
    where Id = @childElementId;

    while @parentId <> 0

        update ops.EPValue
        set value = x.Value, UpdatedAt = getdate(), UpdatedBy = SUSER_NAME()
        from ops.EPValue ep
        inner join
            select p.Id PeriodId, 
                    sum(case when se.SummationAction = ''+'' then 1.0 else -1.0 end * cp.Value) Value
            from config.StructureElement se
            cross join cal.Period p
            inner join ops.EPValue cp on cp.ElementId = se.Id and cp.PeriodId = p.Id
            where se.SummationParentId = @parentId
            and p.PeriodStartUtc >= @startUtc
            and p.PeriodEndUtc <= @endUtc
            group by p.Id
        ) x on x.PeriodId = ep.PeriodId
        where ep.ElementId = @parentId;

        select @parentId = isnull(SummationParentId, 0)
        from config.StructureElement
        where Id = @parentId;