YAFLogo

tommyboy10
  • tommyboy10
  • 50.2% (Neutral)
  • YAF Camper Topic Starter
11 years ago
I have been very tenacious and I have worked through all of my .sln issues and then I figured out how to integrate with Sitecore ... I am still working towards integration with Sitecore. my issue now is SQL.This is the following error I am receiving:

FILE:

mssql/procedures.sql

ERROR:

Ambiguous column name 'Description'.

STATEMENT:

create procedure [dbo].[yaf_forum_listread](@BoardID int,@UserID int,@CategoryID int=null,@ParentID int=null) as

begin

Note; this is not happening in the Standalone product.

what can I do?

Thank you in advance for any assitance.

Regards,

Sponsor
bbobb
  • bbobb
  • 100% (Exalted)
  • YAF Developer
11 years ago
Post the sp text. You should add alias for Description column explicitely in a place.

tommyboy10
  • tommyboy10
  • 50.2% (Neutral)
  • YAF Camper Topic Starter
11 years ago
thank you for the quick response Bbobb, I am afraid I am not following: here is the error I received, perhaps you could clarify what needs to be done here.

thank you in advance, as you are the first person to ever respond to me on this forum.

Source Error:

Line 537:

Line 538:

Line 539: DB.system_initialize_executescripts(script,scriptFile, useTransactions);

Line 540:

Line 541: }

Source File: c:\inetpub\wwwroot\MEAU_YAF\Website\yaf\install\default.aspx.cs Line: 539

Stack Trace:

[Exception: FILE:

mssql/procedures.sql

ERROR:

Ambiguous column name 'Description'.

STATEMENT:

create procedure [dbo].[yaf_forum_listread](@BoardID int,@UserID int,@CategoryID int=null,@ParentID int=null) as

begin

select

a.CategoryID,

Category = a.Name,

ForumID = b.ForumID,

Forum = b.Name,

Description,

Topics = [dbo].[yaf_forum_topics](b.ForumID),

Posts = [dbo].[yaf_forum_posts](b.ForumID),

Subforums = [dbo].[yaf_forum_subforums](b.ForumID, @UserID),

LastPosted = t.LastPosted,

LastMessageID = t.LastMessageID,

LastUserID = t.LastUserID,

LastUser = IsNull(t.LastUserName,(select Name from [dbo].[yaf_User] x where x.UserID=t.LastUserID)),

LastTopicID = t.TopicID,

LastTopicName = t.Topic,

b.Flags,

Viewing = (select count(1) from [dbo].[yaf_Active] x JOIN [dbo].[yaf_User] usr ON x.UserID = usr.UserID where x.ForumID=b.ForumID AND usr.IsActiveExcluded = 0),

b.RemoteURL,

x.ReadAccess

from

[dbo].[yaf_Category] a

join [dbo].[yaf_Forum] b on b.CategoryID=a.CategoryID

join [dbo].[yaf_vaccess] x on x.ForumID=b.ForumID

left outer join [dbo].[yaf_Topic] t ON t.TopicID = [dbo].[yaf_forum_lasttopic](b.ForumID,@UserID,b.LastTopicID,b.LastPosted)

where

a.BoardID = @BoardID and

((b.Flags & 2)=0 or x.ReadAccess<>0) and

(@CategoryID is null or a.CategoryID=@CategoryID) and

((@ParentID is null and b.ParentID is null) or b.ParentID=@ParentID) and

x.UserID = @UserID

order by

a.SortOrder,

b.SortOrder

end]

bbobb
  • bbobb
  • 100% (Exalted)
  • YAF Developer
11 years ago

create procedure [dbo].[yaf_forum_listread](@BoardID int,@UserID int,@CategoryID int=null,@ParentID int=null) as

begin

select

a.CategoryID,

Category = a.Name,

ForumID = b.ForumID,

Forum = b.Name,

b.Description,

...

Originally Posted by: tommyboy10 

tommyboy10
  • tommyboy10
  • 50.2% (Neutral)
  • YAF Camper Topic Starter
11 years ago
Here is what I did in my SQL ... if you page down you will find "Description" ...

it originally was originally b.[Description], I changed it to b.Description .... I did a Drop and Create in SQL, but the error is still present.

and once again this is only happening in Sitecore, not Stand alone.

Thank you for all of your assistance.

Regards,

Paul T. Rykiel, PMP, CSM

USE [YAF_DB]

GO

/****** Object: StoredProcedure [dbo].[yaf_forum_listread] Script Date: 05/28/2013 11:53:33 ******/

IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[yaf_forum_listread]') AND type in (N'P', N'PC'))

DROP PROCEDURE [dbo].[yaf_forum_listread]

GO

USE [YAF_DB]

GO

/****** Object: StoredProcedure [dbo].[yaf_forum_listread] Script Date: 05/28/2013 11:53:33 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

create procedure [dbo].[yaf_forum_listread](@BoardID int,@UserID int,@CategoryID int=null,@ParentID int=null, @StyledNicks bit=null, @FindLastRead bit = 0) as

begin

declare @tbl1 table

( ForumID int, ParentID int)

declare @tbl table

( ForumID int, ParentID int)

-- get parent forums list first

insert into @tbl1(ForumID,ParentID)

select

b.ForumID,

b.ParentID

from

[dbo].[yaf_Category] a with(nolock)

join [dbo].[yaf_Forum] b with(nolock) on b.CategoryID=a.CategoryID

join [dbo].[yaf_ActiveAccess] x with(nolock) on x.ForumID=b.ForumID

where

a.BoardID = @BoardID and

((b.Flags & 2)=0 or x.ReadAccess<>0) and

(@CategoryID is null or a.CategoryID=@CategoryID) and

((@ParentID is null and b.ParentID is null) or b.ParentID=@ParentID) and

x.UserID = @UserID

order by

a.SortOrder,

b.SortOrder

-- child forums

insert into @tbl(ForumID,ParentID)

select

b.ForumID,

b.ParentID

from

[dbo].[yaf_Category] a with(nolock)

join [dbo].[yaf_Forum] b with(nolock) on b.CategoryID=a.CategoryID

join [dbo].[yaf_ActiveAccess] x with(nolock) on x.ForumID=b.ForumID

where

a.BoardID = @BoardID and

((b.Flags & 2)=0 or x.ReadAccess<>0) and

(@CategoryID is null or a.CategoryID=@CategoryID) and

(b.ParentID IN (SELECT ForumID FROM @tbl1)) and

x.UserID = @UserID

order by

a.SortOrder,

b.SortOrder

insert into @tbl(ForumID,ParentID)

select * FROM @tbl1

-- more childrens can be added to display as a tree

select

a.CategoryID,

Category = a.Name,

ForumID = b.ForumID,

Forum = b.Name,

b.Description,

b.ImageUrl,

b.Styles,

b.ParentID,

b.PollGroupID,

Topics = [dbo].[yaf_forum_topics](b.ForumID),

Posts = [dbo].[yaf_forum_posts](b.ForumID),

LastPosted = t.LastPosted,

LastMessageID = t.LastMessageID,

LastMessageFlags = t.LastMessageFlags,

LastUserID = t.LastUserID,

LastUser = IsNull(t.LastUserName,(select [Name] from [dbo].[yaf_User] x with(nolock) where x.UserID=t.LastUserID)),

LastTopicID = t.TopicID,

TopicMovedID = t.TopicMovedID,

LastTopicName = t.Topic,

LastTopicStatus = t.Status,

LastTopicStyles = t.Styles,

b.Flags,

Viewing = (select count(1) from [dbo].[yaf_Active] x with(nolock) JOIN [dbo].[yaf_User] usr with(nolock) ON x.UserID = usr.UserID where x.ForumID=b.ForumID AND usr.IsActiveExcluded = 0),

b.RemoteURL,

ReadAccess = CONVERT(int,x.ReadAccess),

Style = case(@StyledNicks)

when 1 then (select top 1 usr.[UserStyle] from [dbo].[yaf_User] usr with(nolock) where usr.UserID = t.LastUserID)

else '' end,

LastForumAccess = case(@FindLastRead)

when 1 then

(SELECT top 1 LastAccessDate FROM [dbo].[yaf_ForumReadTracking] x with(nolock) WHERE x.ForumID=b.ForumID AND x.UserID = @UserID)

else '' end,

LastTopicAccess = case(@FindLastRead)

when 1 then

(SELECT top 1 LastAccessDate FROM [dbo].[yaf_TopicReadTracking] y with(nolock) WHERE y.TopicID=t.TopicID AND y.UserID = @UserID)

else '' end

from

[dbo].[yaf_Category] a with(nolock)

join [dbo].[yaf_Forum] b with(nolock) on b.CategoryID=a.CategoryID

join [dbo].[yaf_ActiveAccess] x with(nolock) on x.ForumID=b.ForumID

left outer join [dbo].[yaf_Topic] t with(nolock) ON t.TopicID = [dbo].[yaf_forum_lasttopic](b.ForumID,@UserID,b.LastTopicID,b.LastPosted)

where

(@CategoryID is null or a.CategoryID=@CategoryID) and

x.UserID = @UserID and

(b.ForumID IN (SELECT ForumID FROM @tbl) )

order by

a.SortOrder,

b.SortOrder

end

GO

tommyboy10
  • tommyboy10
  • 50.2% (Neutral)
  • YAF Camper Topic Starter
11 years ago
this is now corrected ... the SQL table was in the Installation MSSQL/procedures.sql

I modified the code procedures.sql and it ran.

Thank you for all of your assistance.

Regards,