SQL
USE [PrintMonitor]
GO
/****** Object:  StoredProcedure [dbo].[Add_Server]    Script Date: 10/15/2008 20:34:01 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[Add_Server]
	(
		@ServerName varchar(255)
    )
AS
	SET NOCOUNT ON 
	
	IF NOT EXISTS (SELECT 'A' FROM dbo.[Print Servers]
	                WHERE Name = @ServerName
	               )
	               
	        INSERT INTO dbo.[Print Servers]
	            (
	            Name,
	            License,
	            [User name],
	            Timestamp
	            )
	        VALUES
	            (
	            @Servername,
	            NewId(),
	            suser_sname(),
	            getdate()
	            )
	
	RETURN 

Last edited Oct 15, 2008 at 7:34 PM by Merrion, version 1

Comments

No comments yet.