Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Pulling Highest Number from Table

Author  Topic 

Ayeidea
Starting Member

17 Posts

Posted - 2001-11-20 : 12:22:47
Ok i have an admin page that user can insert a banner into the database. Each banner needs to have a possition, with 1 being top of the page and any number past that below 1 in order. Now i pull form a SP a list of possitions allready taken and list them. what i would like to do is also Take the last position and add 1 to it. so if the highest number is 4, it would list 1 - 5. anyone know how i can write this in. should i do a function on my asp page or put it into the sp. here is the sp
quote:
CREATE PROCEDURE sp_List_Pos
(
@side smallint
)
AS
SELECT Lside,Lpos
FROM Pic_Link_tbl
WHERE Lside = @side
ORDER BY Lpos ASC



any ideas?
Here is the listcode on the page also:
quote:
 <select name="lPos"><option value="<% DefPos(1)%>">
<% DefPos(1)%>
</option>
<%
While (NOT posRS.EOF)
%>
<option value="<%= posRS.Fields.Item("Lpos").Value %>" ><%= posRS.Fields.Item("Lpos").Value %></option>
<%
posRS.MoveNext()
Wend
If (posRS.CursorType > 0) Then
posRS.MoveFirst
Else
posRS.Requery
End If
%>

</select>





Edited by - AyeIdea on 11/20/2001 12:24:40
   

- Advertisement -