Skip to content

Instantly share code, notes, and snippets.

@codenamejason
Created January 2, 2018 16:16
Show Gist options
  • Save codenamejason/f550bc6509003fe64c4ef182f973606e to your computer and use it in GitHub Desktop.
Save codenamejason/f550bc6509003fe64c4ef182f973606e to your computer and use it in GitHub Desktop.
IF EXISTS(SELECT * FROM information_Schema.routines WHERE Specific_Name = 'LogStatus' )
DROP PROCEDURE LogStatus
GO
CREATE PROCEDURE dbo.LogStatus(@Msg AS VARCHAR(MAX)=NULL)
AS
BEGIN
DECLARE @CurrTime AS VARCHAR(100)
SET @CurrTime = GETDATE()
set @msg = (select [Name] from sys.Filegroups where is_default=1)
+ ': ' + @Msg
IF @msg IS NULL
RAISERROR ('(%s) ',0,1, @CurrTime ) WITH NOWAIT
ELSE
RAISERROR ('(%s) %s',0,1, @CurrTime, @Msg) WITH NOWAIT
Insert Into CountyMessages(Message) values(@Msg)
END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment