Don't know how much more I might be able to help, but what I started doing was finding the bloody functions that had @ModuleId in them and changed them to @ModuleID. Even within the function itself. I did it all from notepad in Windows. You'll need to do the same for all of them. Then try and run again. Until all the scalar errors go away.
If it is saying something about being undeclared, ick!
Not being a MSSQL genius, I had to do a bit of research on how to do that darn statements properly, even how to declare variables.
Get one of the create procedure statements and run it through SQL manager.
If you get scalar errors change all the @{variables} to lower case, upper case, or what ever case is your preference.
If you get undeclared @{variable} then here comes the Declare option. It worked for me, may work for you. Let's say I fat fingered the @PortalID (Like the authors of the original functions did and thus why you are getting scalar errors, who cares if DNN doesn't support CS collation some sort of standards need to be followed in the coding of functions, but that's MHO)
To correct the scalar error(s) on @portalID, @PortalID, @portalId, or @whatever...Is do a blanket search and replace for (I used notepad and turned of case sensing) @portalid with @PortalId. And there you go. Scalar error resolved. Apply the same concept to all @variables. In this case also @BannerTypeId (replace with @BannerTypeID, for example), and @GroupName (replace with @GroupName, for example). So long as you turn off case sensing in search and replace all items will be flipped to the same thing. Yes!
But what about undeclared variables? Got me, I got an undeclared once and rewrote the statement after experimenting with the Declare option. If you have your scalars resolved create a new thread with your undeclared variable issue. Find the function where the error is occuring, hopefully DNN is giving you a hint. I think I had to turn on debugging then read it backwards. Put the function in the posting. Also futz with the Declare option. And probably a good idea, if you create a new thread post a link here to your thread. So folks can find that and follow along. :)
create procedure {databaseOwner}{objectQualifier}FindBanners
@PortalID int,
@BannerTypeId int,
@GroupName nvarchar(100)
AS
SELECT BannerId,
{objectQualifier}Banners.VendorId,
BannerName,
URL,
'ImageFile' = case when {objectQualifier}Files.FileName is null then {objectQualifier}Banners.ImageFile else {objectQualifier}Files.Folder + {objectQualifier}Files.FileName end,
Impressions,
CPM,
{objectQualifier}Banners.Views,
{objectQualifier}Banners.ClickThroughs,
StartDate,
EndDate,
BannerTypeId,
Description,
GroupName,
Criteria,
{objectQualifier}Banners.Width,
{objectQualifier}Banners.Height
FROM {objectQualifier}Banners
INNER JOIN {objectQualifier}Vendors ON {objectQualifier}Banners.VendorId = {objectQualifier}Vendors.VendorId
LEFT OUTER JOIN {objectQualifier}Files ON {objectQualifier}Banners.ImageFile = 'fileid=' + convert(varchar,{objectQualifier}Files.FileID)
WHERE ({objectQualifier}Banners.BannerTypeId = @BannerTypeId or @BannerTypeId is null)
AND ({objectQualifier}Banners.GroupName = @GroupName or @GroupName is null)
AND (({objectQualifier}Vendors.PortalId = @PortalId) or (@PortalId is null and {objectQualifier}Vendors.PortalId is null))
AND {objectQualifier}Vendors.Authorized = 1
ORDER BY BannerId
GO
/************************************************************/
/***** SqlDataProvider *****/
/************************************************************/