469,934 Members | 2,757 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,934 developers. It's quick & easy.

Problem in stored procedure in the last line plz help

HI here is the stored procedure

CREATE Procedure dm_deleteBBPost
(
@TopicID numeric,
@ForumID numeric

)
As
declare @netCount as int

BEGIN
Select @netCount=count(*) from tblBBPosts where TopicID=@TopicID

update tblBBForums set TotalTopics=TotalTopics-1,TotalPosts=TotalPosts-@netCount where ForumID=@ForumID

Delete From tblBBPosts Where TopicID = @TopicID
Delete From tblBBTopics Where TopicID =@TopicID

end
declare @pr_ForumsToday as varchar
declare @topicname as varchar

SELECT TOP 1 @topicname=Topics FROM tblBBTopics ORDER BY LastPostDate DESC
@pr_ForumsToday= ' <p><A href=''bbviewposts.asp?id="'+ TopicID +'>' +left(@topicname,50) + ' ...</a>" & "</p>")'
GO



i am getting error in the @pr_ForumsToday line
syntax error i think plz can any body help
Jul 19 '07 #1
1 847
ck9663
2,878 Expert 2GB
HI here is the stored procedure

CREATE Procedure dm_deleteBBPost
(
@TopicID numeric,
@ForumID numeric

)
As
declare @netCount as int

BEGIN
Select @netCount=count(*) from tblBBPosts where TopicID=@TopicID

update tblBBForums set TotalTopics=TotalTopics-1,TotalPosts=TotalPosts-@netCount where ForumID=@ForumID

Delete From tblBBPosts Where TopicID = @TopicID
Delete From tblBBTopics Where TopicID =@TopicID

end
declare @pr_ForumsToday as varchar
declare @topicname as varchar

SELECT TOP 1 @topicname=Topics FROM tblBBTopics ORDER BY LastPostDate DESC
@pr_ForumsToday= ' <p><A href=''bbviewposts.asp?id="'+ TopicID +'>' +left(@topicname,50) + ' ...</a>" & "</p>")'
GO



i am getting error in the @pr_ForumsToday line
syntax error i think plz can any body help

TRY:

set @pr_ForumsToday= ' <p><A href=''bbviewposts.asp?id="'+ TopicID +'>' +left(@topicname,50) + ' ...</a>" & "</p>")'

or

select @pr_ForumsToday= ' <p><A href=''bbviewposts.asp?id="'+ TopicID +'>' +left(@topicname,50) + ' ...</a>" & "</p>")'
Jul 19 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

8 posts views Thread by Wonderinguy | last post: by
2 posts views Thread by Kent Lewandowski | last post: by
4 posts views Thread by =?Utf-8?B?QmFidU1hbg==?= | last post: by
7 posts views Thread by eholz1 | last post: by
reply views Thread by SOI_0152 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.