Hi,

I'm Newbie of Store Procedure.

Below is my Store Procedure code :
I need to count if notified message found inside database > 0 then pop up message.

sql Code:
  1. USE [Maintenance]
  2. GO
  3. /****** Object:  StoredProcedure [WANSERN\wansern].[sp_WoBreakDownNotif]    Script Date: 12/18/2007 11:50:11 ******/
  4. SET ANSI_NULLS ON
  5. GO
  6. SET QUOTED_IDENTIFIER ON
  7. GO
  8.  
  9. ALTER PROCEDURE [WANSERN\wansern].[sp_WoBreakDownNotif]
  10.     -- Add the parameters for the stored procedure here
  11.     @myStatus varchar(50)
  12. AS
  13. SELECT    dbo.Notif_WO.Ref_No, dbo.Notif_WO.MsgLoc, dbo.Machine_Desc.Mac_Code, dbo.WOList.Date_WO, dbo.WOList.Dept, dbo.WOList.Ref_To
  14. FROM      dbo.WOList INNER JOIN
  15.           dbo.Machine_Desc ON dbo.WOList.Mac_Code = dbo.Machine_Desc.Mac_Code INNER JOIN
  16.           dbo.Notif_WO ON dbo.WOList.Ref_No = dbo.Notif_WO.Ref_No
  17. WHERE  dbo.Notif_WO.Status = @myStatus
  18. BEGIN
  19.     -- SET NOCOUNT ON added to prevent extra result sets from
  20.     -- interfering with SELECT statements.
  21.     SET NOCOUNT ON;
  22.    
  23.     -- Insert statements for procedure here
  24.    
  25. END

Another Question : How to call Store procedure from SQL Express via VB6 ?

Thanks for help ....