You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
101 lines
5.3 KiB
101 lines
5.3 KiB
USE [Vertragsverwaltung_20160404]
|
|
GO
|
|
/****** Object: StoredProcedure [dbo].[dt_addtosourcecontrol] Script Date: 02.12.2016 09:08:54 ******/
|
|
DROP PROCEDURE [dbo].[dt_addtosourcecontrol]
|
|
GO
|
|
/****** Object: StoredProcedure [dbo].[dt_addtosourcecontrol] Script Date: 02.12.2016 09:08:54 ******/
|
|
SET ANSI_NULLS ON
|
|
GO
|
|
SET QUOTED_IDENTIFIER OFF
|
|
GO
|
|
create proc [dbo].[dt_addtosourcecontrol]
|
|
@vchSourceSafeINI varchar(255) = '',
|
|
@vchProjectName varchar(255) ='',
|
|
@vchComment varchar(255) ='',
|
|
@vchLoginName varchar(255) ='',
|
|
@vchPassword varchar(255) =''
|
|
|
|
as
|
|
|
|
set nocount on
|
|
|
|
declare @iReturn int
|
|
declare @iObjectId int
|
|
select @iObjectId = 0
|
|
|
|
declare @iStreamObjectId int
|
|
select @iStreamObjectId = 0
|
|
|
|
declare @VSSGUID varchar(100)
|
|
select @VSSGUID = 'SQLVersionControl.VCS_SQL'
|
|
|
|
declare @vchDatabaseName varchar(255)
|
|
select @vchDatabaseName = db_name()
|
|
|
|
declare @iReturnValue int
|
|
select @iReturnValue = 0
|
|
|
|
declare @iPropertyObjectId int
|
|
declare @vchParentId varchar(255)
|
|
|
|
declare @iObjectCount int
|
|
select @iObjectCount = 0
|
|
|
|
exec @iReturn = master.dbo.sp_OACreate @VSSGUID, @iObjectId OUT
|
|
if @iReturn <> 0 GOTO E_OAError
|
|
|
|
|
|
/* Create Project in SS */
|
|
exec @iReturn = master.dbo.sp_OAMethod @iObjectId,
|
|
'AddProjectToSourceSafe',
|
|
NULL,
|
|
@vchSourceSafeINI,
|
|
@vchProjectName output,
|
|
@@SERVERNAME,
|
|
@vchDatabaseName,
|
|
@vchLoginName,
|
|
@vchPassword,
|
|
@vchComment
|
|
|
|
|
|
if @iReturn <> 0 GOTO E_OAError
|
|
|
|
/* Set Database Properties */
|
|
|
|
begin tran SetProperties
|
|
|
|
/* add high level object */
|
|
|
|
exec @iPropertyObjectId = dbo.dt_adduserobject_vcs 'VCSProjectID'
|
|
|
|
select @vchParentId = CONVERT(varchar(255),@iPropertyObjectId)
|
|
|
|
exec dbo.dt_setpropertybyid @iPropertyObjectId, 'VCSProjectID', @vchParentId , NULL
|
|
exec dbo.dt_setpropertybyid @iPropertyObjectId, 'VCSProject' , @vchProjectName , NULL
|
|
exec dbo.dt_setpropertybyid @iPropertyObjectId, 'VCSSourceSafeINI' , @vchSourceSafeINI , NULL
|
|
exec dbo.dt_setpropertybyid @iPropertyObjectId, 'VCSSQLServer', @@SERVERNAME, NULL
|
|
exec dbo.dt_setpropertybyid @iPropertyObjectId, 'VCSSQLDatabase', @vchDatabaseName, NULL
|
|
|
|
if @@error <> 0 GOTO E_General_Error
|
|
|
|
commit tran SetProperties
|
|
|
|
select @iObjectCount = 0;
|
|
|
|
CleanUp:
|
|
select @vchProjectName
|
|
select @iObjectCount
|
|
return
|
|
|
|
E_General_Error:
|
|
/* this is an all or nothing. No specific error messages */
|
|
goto CleanUp
|
|
|
|
E_OAError:
|
|
exec dbo.dt_displayoaerror @iObjectId, @iReturn
|
|
goto CleanUp
|
|
|
|
|
|
|
|
GO
|