I have this stored procedure which get data from excell and then update status:
ALTER PROCEDURE [dbo].[sp_AllocateSerial] @Limit int, @Part varchar (50), @Status varchar(50) AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; -- Insert statements for procedure here SELECT TOP (@LIMIT) PartNumber,SerialNumber,Batch,Location,PalletNumber,Status FROM dbo.FG_FILLIN where Status='FG-FRESH' and PartNumber=@Part ORDER BY PartNumber END Now:
If my serial numbers Status is Allocated I want to show an error message that the serial has already been allocated.