0

Hi, I am a new in stored procedure and I now do the following function:

ALTER PROCEDURE dbo.ViewFaultyTbl
	@id int
		
AS
	 SET NOCOUNT ON;
	 DECLARE @indicator int
	 
	 SELECT @indicator=Indicator
	  FROM FautyScanTbl  
	  
	  if @indicator=0
	  BEGIN
	  
	  SELECT *
	  FROM FautyScanTbl
	  WHERE	ID=@id	  
	  
	  END	  
	  
	  ELSE
	 	 BEGIN
	 	 
	 	 
	 	 
	 	 END

Indicator is a column in my table which is integer, in my program, every time it wants do a function, it must check the indicator column (default 0). If 0, then it will do event(if), if 1, then i will skips the row and go to next record.
I don't know how to write the statement inside, can someone help me please.

1
Contributor
1
Reply
2
Views
6 Years
Discussion Span
Last Post by leo88
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.