Created
April 26, 2016 16:21
-
-
Save micmaher/1068b394f3cd5e7bce7b1a66190aaed9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USE [build] | |
GO | |
/****** Object: StoredProcedure [dbo].[inserthotfixPresent] Script Date: 26/04/2016 17:21:13 ******/ | |
SET ANSI_NULLS ON | |
GO | |
SET QUOTED_IDENTIFIER ON | |
GO | |
/* | |
Procedure that will allow you to update or insert the storage table. | |
This will make sure that there is no duplicates | |
*/ | |
CREATE PROCEDURE [dbo].[inserthotfixPresent] | |
@hostname nvarchar(24), | |
@hotfixpresent char (3) | |
AS | |
IF NOT EXISTS(SELECT hostname FROM dbo.hotfixpresent WHERE hostname = @hostname) | |
BEGIN | |
INSERT INTO dbo.hotfixPresent VALUES(@hostname, @hotfixpresent, GETDATE()) | |
END; | |
ELSE | |
BEGIN | |
UPDATE dbo.hotfixpresent | |
SET hotfixpresent =@hotfixpresent, lastupdate = GETDATE() | |
WHERE hostname=@hostname | |
END; | |
GO | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment