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)
 Case

Author  Topic 

iamsmahd
Yak Posting Veteran

55 Posts

Posted - 2005-09-22 : 07:31:59
Hi there....
I have created this stored proc. ::

Create Stored Procedure dbo.xyz_1
AS

declare @type bit

SELECT DISTINCT dbo.Product.PCode, dbo.Order.ODescription, Case @type when 1 then 'x' when 0 then 'y' end as type,
CASE
WHEN (subquery1) ='d' THEN
CASE
WHEN (subquery2) >100 THEN (subquery3)
WHEN (subquery2) <100 THEN

begin
Set @type=1
Case WHEN ..
END

End
END AS Price

FROM .......
WHERE .......
-------------------------

but I get error f

what's wrong?



sonia

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-09-22 : 07:38:32
I think you cant set value to variable inside select statement
Can you explain what you are trying to do?
Post table Structure, sample data and the result you want

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -