Stored Procedure help! Urgent!

Results 1 to 3 of 3

Thread: Stored Procedure help! Urgent!

  1. #1
    Rob Guest

    Default Stored Procedure help! Urgent!

    ok<BR>I&#039;m trying to convert the three SQL statements below into 1 stored procedure for SQL Server 2000<BR><BR>SQL1 = "SELECT section,title FROM articles WHERE section LIKE &#039;" & sectionid & "%&#039; ORDER BY section "<BR>SQL2 = "Select * FROM articles WHERE section=&#039;" & articleid & "&#039; "<BR>SQL3 = "UPDATE articles SET articles.hits = [hits]+1 WHERE section=&#039;" & articleid & "&#039; " <BR><BR>But I&#039;m stuck! This is what I have so far<BR><BR>CREATE PROCEDURE dp_grabarticle <BR>( <BR>@sectionid varchar(10),<BR>@title varchar(30) OUTPUT,<BR>@updated varchar(10) OUTPUT,<BR>@content varchar(40) OUTPUT<BR> )<BR>AS<BR>SELECT sectionid, title, updated, content <BR>FROM articles<BR>WHERE sectionid = @sectionid <BR><BR>GO<BR><BR>Can anyone help me and give post some good links to sites on Stored procedures!<BR><BR>Thanks,<BR>Rob

  2. #2
    Join Date
    Dec 1969

    Default Are you trying to do this?

    &nbsp;<BR> Select @Title = Title,<BR> @Updated = Updated,<BR> @Content = Content<BR> where SectionID = @SectionId<BR><BR> If not, I&#039;m confused at what you are asking...

  3. #3
    Rob Guest

    Default RE: Are you trying to do this?

    Hi, I need to input a variable from ASP (sectionid) and pull out the title,updated and content.<BR>I think it should be<BR><BR>Select @Title = Title OUTPUT,<BR>@Updated = Updated OUTPUT,<BR>@Content = Content OUTPUT<BR>where SectionID = @SectionId<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts