Added logic to keep this script from running in the system databases.

Added warning messages if changes exist to fmtxml or promsfixes.sql.
This commit is contained in:
Rich
2013-03-14 20:42:06 +00:00
parent be014b12b3
commit 49077fccb5
2 changed files with 59 additions and 1 deletions

View File

@@ -1,3 +1,19 @@
if db_name() in('master','model','msdn','tempdb')
begin
DECLARE @ErrorMsg varchar(255)
SET @ErrorMsg = 'Don''t add these procedures and functions to ' + db_name()
PRINT '=========================================================================='
PRINT ''
PRINT @ErrorMsg
PRINT ''
PRINT 'You probably want to be in the VEPROMS database'
PRINT ''
PRINT '=========================================================================='
RAISERROR (@ErrorMsg, 20, -1) with log
RETURN
end
print 'Adding procedures and functions to ' + db_name()
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[PasteItemReplace]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
DROP PROCEDURE [PasteItemReplace];
GO