-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: SureshScribnar
Message 1 in Discussion


I have a table products with field id int, name nvarchar(50). I would like to get all 
the names as a single column or in a variable in a stored procedure . We could use 
Select SUM(id) from products. But, since the name is nvarchar i'm not able to do this 
on the name field as its known that the nvarchar cant be summed. 
I tried the other way in the sp   declare @n nvarchar(1000)
select @n= [name]  from products
select @n   but, i only get the name of the last row in the products table. FYI, i 
have 5 rows in the table.     When i try the following i get an error.  "Subquery 
returned more than 1 value. This is not permitted when the subquery follows =, !=, <, 
<= , >, >= or when the subquery is used as an expression."   declare @n nvarchar(1000)
set @n =(select  [name]  from products)
select @n   can you please siggest if  there is any other way to do this other than 
using CURSORS, so that i get result in a single variable?   Thanks!

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/BDotNet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to