SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[adminPopulateSysmessages]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[adminPopulateSysmessages]
GO


create procedure dbo.adminPopulateSysmessages
as
/************************************************************************************
All error messages for the Change Control subsystem are maintained by this procedure.
To add remove or modify a message edit this procedure and run it. It is necessary to
check for existance, drop if found and then add each message to avoid spurious errors 
returning from the procedure's execution   
*************************************************************************************/
-- use this procedure to document all error messages for the enterprise

if exists(select 1 from master.dbo.sysmessages where error = 59000)
	exec master.dbo.sp_dropmessage 59000
exec master.dbo.sp_addmessage  59000, 
				16, 
				'%s: Failed! See previous messages for details'

if exists(select 1 from master.dbo.sysmessages where error = 59001)
	exec master.dbo.sp_dropmessage 59001
exec master.dbo.sp_addmessage  59001, 
				16, 
				'%s: Failed! See Admin.dbo.activityLog for details'

if exists(select 1 from master.dbo.sysmessages where error = 59002)
	exec master.dbo.sp_dropmessage 59002
exec master.dbo.sp_addmessage  59002, 
				16, 
				'%s: Active project not found for database: %s!'

if exists(select 1 from master.dbo.sysmessages where error = 59003)
	exec master.dbo.sp_dropmessage 59003
exec master.dbo.sp_addmessage  59003, 
				16, 
				'%s: %s is not a valid node in specified hierarchy of project %s'

if exists(select 1 from master.dbo.sysmessages where error = 59004)
	exec master.dbo.sp_dropmessage 59004
exec master.dbo.sp_addmessage  59004, 
				16, 
				'%s: Invalid drive %s specified!'

if exists(select 1 from master.dbo.sysmessages where error = 59005)
	exec master.dbo.sp_dropmessage 59005
exec master.dbo.sp_addmessage  59005, 
				16, 
				'%s: Unable to verify SourceSafe user %s in share %s'

if exists(select 1 from master.dbo.sysmessages where error = 59006)
	exec master.dbo.sp_dropmessage 59006
exec master.dbo.sp_addmessage  59006, 
				16, 
				'%s: Unable to verify database %s on SQL Server %s'

if exists(select 1 from master.dbo.sysmessages where error = 59007)
	exec master.dbo.sp_dropmessage 59007
exec master.dbo.sp_addmessage  59007, 
				16, 
				'%s: Unable to verify file system folder %s on Server %s'

if exists(select 1 from master.dbo.sysmessages where error = 59008)
	exec master.dbo.sp_dropmessage 59008
exec master.dbo.sp_addmessage  59008, 
				16, 
				'%s: Unable to verify SourceSafe project %s in share %s'

if exists(select 1 from master.dbo.sysmessages where error = 59009)
	exec master.dbo.sp_dropmessage 59009
exec master.dbo.sp_addmessage  59009, 
				16, 
				'%s: The project %s already exists for database %s'

if exists(select 1 from master.dbo.sysmessages where error = 59010)
	exec master.dbo.sp_dropmessage 59010
exec master.dbo.sp_addmessage  59010, 
				16, 
				'%s: Objects are checked out in project %s'

if exists(select 1 from master.dbo.sysmessages where error = 59011)
	exec master.dbo.sp_dropmessage 59011
exec master.dbo.sp_addmessage  59011, 
				16, 
				'%s: Unable to verify SourceSafe project %s for remote server %s'

if exists(select 1 from master.dbo.sysmessages where error = 59012)
	exec master.dbo.sp_dropmessage 59012
exec master.dbo.sp_addmessage  59012, 
				16, 
				'%s: osql call failed %s'

if exists(select 1 from master.dbo.sysmessages where error = 59013)
	exec master.dbo.sp_dropmessage 59013
exec master.dbo.sp_addmessage  59013, 
				16, 
				'%s: Error processing script %s. See output file %s in folder %s for details'



GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

