Can anyone help, i'm just starting out with MS SQL on a new web page and i'm having problems writing a stored procdure, its for a simple forum on a web page.
I have a table with the main forum information, i then have a stored procdure
"SELECT Count(forum.ID) AS CountOfID, forum.partID
FROM forum
GROUP BY forum.partID
HAVING (((forum.partID )<>0));"
this is to work out which is the main posts and not the replies, i then have the main table with all the records.
i then am trying to write another stored procdure that looks at the main forum table and combines that with the stored procdure, however i can seem to get the last stored procdure to work, can a stored prcdure use a SELECT statment for a stored procdure and a table, or do i need to prefix the stored procedure with some thing??
SELECT forum.ForumID, forum.ID, forum.partID, CountofUsers.Co untOfID, forum.subject, forum.author, forum.message, forum.responder , forum.dtDate, forum.email, forum.forumIP, forum.PicID
FROM forum LEFT JOIN CountofUsers ON forum.ID = CountofUsers.pa rtID;
Forum is the table
CountofUsers is the stored procdure
I have a table with the main forum information, i then have a stored procdure
"SELECT Count(forum.ID) AS CountOfID, forum.partID
FROM forum
GROUP BY forum.partID
HAVING (((forum.partID )<>0));"
this is to work out which is the main posts and not the replies, i then have the main table with all the records.
i then am trying to write another stored procdure that looks at the main forum table and combines that with the stored procdure, however i can seem to get the last stored procdure to work, can a stored prcdure use a SELECT statment for a stored procdure and a table, or do i need to prefix the stored procedure with some thing??
SELECT forum.ForumID, forum.ID, forum.partID, CountofUsers.Co untOfID, forum.subject, forum.author, forum.message, forum.responder , forum.dtDate, forum.email, forum.forumIP, forum.PicID
FROM forum LEFT JOIN CountofUsers ON forum.ID = CountofUsers.pa rtID;
Forum is the table
CountofUsers is the stored procdure
Comment