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)
 append select results to string

Author  Topic 

Vivaldi
Constraint Violating Yak Guru

298 Posts

Posted - 2001-07-17 : 14:02:13
Well

I have a basic sql question.

I am attempting to return a complete string of a select list to an asp page.

(there is an intense amount of processing of the option elements for the list)

I wrote a stored proc to grab the options.

I was hoping that I could build the
<select name=mylist size=1>
into a string var
like:
declare @returnstring varchar(500)

Set @returnstring = '<select name=mylist>'

then append the select statement parts with the HTML option tags to the string and simply return the string, as to completely minimize the ASP processing on the page.

so then I could say something like
Set @returnstring = @returnstring +(Select '<option value=' + @domain menuitemurl '>' + menuitemname + '</option>'
from MenuItem mi ...

(this returns an error, as expected)

I know this is quite simple with a Cursor
and I read http://www.sqlteam.com/item.asp?ItemID=256

But, can this be done without Cursors,
I am more curious than anything.



Edited by - vivaldi on 07/17/2001 14:03:41
   

- Advertisement -