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.
106 lines
6.8 KiB
106 lines
6.8 KiB
USE [Vertragsverwaltung_20160404]
|
|
GO
|
|
/****** Object: StoredProcedure [dbo].[dt_isundersourcecontrol] Script Date: 02.12.2016 09:08:54 ******/
|
|
DROP PROCEDURE [dbo].[dt_isundersourcecontrol]
|
|
GO
|
|
/****** Object: StoredProcedure [dbo].[dt_isundersourcecontrol] Script Date: 02.12.2016 09:08:54 ******/
|
|
SET ANSI_NULLS ON
|
|
GO
|
|
SET QUOTED_IDENTIFIER OFF
|
|
GO
|
|
create proc [dbo].[dt_isundersourcecontrol]
|
|
@vchLoginName varchar(255) = '',
|
|
@vchPassword varchar(255) = '',
|
|
@iWhoToo int = 0 /* 0 => Just check project; 1 => get list of objs */
|
|
|
|
as
|
|
|
|
set nocount on
|
|
|
|
declare @iReturn int
|
|
declare @iObjectId int
|
|
select @iObjectId = 0
|
|
|
|
declare @VSSGUID varchar(100)
|
|
select @VSSGUID = 'SQLVersionControl.VCS_SQL'
|
|
|
|
declare @iReturnValue int
|
|
select @iReturnValue = 0
|
|
|
|
declare @iStreamObjectId int
|
|
select @iStreamObjectId = 0
|
|
|
|
declare @vchTempText varchar(255)
|
|
|
|
declare @iPropertyObjectId int
|
|
select @iPropertyObjectId = (select objectid from dbo.dtproperties where property = 'VCSProjectID')
|
|
|
|
declare @vchProjectName varchar(255)
|
|
declare @vchSourceSafeINI varchar(255)
|
|
declare @vchServerName varchar(255)
|
|
declare @vchDatabaseName varchar(255)
|
|
exec dbo.dt_getpropertiesbyid_vcs @iPropertyObjectId, 'VCSProject', @vchProjectName OUT
|
|
exec dbo.dt_getpropertiesbyid_vcs @iPropertyObjectId, 'VCSSourceSafeINI', @vchSourceSafeINI OUT
|
|
exec dbo.dt_getpropertiesbyid_vcs @iPropertyObjectId, 'VCSSQLServer', @vchServerName OUT
|
|
exec dbo.dt_getpropertiesbyid_vcs @iPropertyObjectId, 'VCSSQLDatabase', @vchDatabaseName OUT
|
|
|
|
if (@vchProjectName = '') set @vchProjectName = null
|
|
if (@vchSourceSafeINI = '') set @vchSourceSafeINI = null
|
|
if (@vchServerName = '') set @vchServerName = null
|
|
if (@vchDatabaseName = '') set @vchDatabaseName = null
|
|
|
|
if (@vchProjectName is null) or (@vchSourceSafeINI is null) or (@vchServerName is null) or (@vchDatabaseName is null)
|
|
begin
|
|
RAISERROR('Not Under Source Control',16,-1)
|
|
return
|
|
end
|
|
|
|
if @iWhoToo = 1
|
|
begin
|
|
|
|
/* Get List of Procs in the project */
|
|
exec @iReturn = master.dbo.sp_OACreate @VSSGUID, @iObjectId OUT
|
|
if @iReturn <> 0 GOTO E_OAError
|
|
|
|
exec @iReturn = master.dbo.sp_OAMethod @iObjectId,
|
|
'GetListOfObjects',
|
|
NULL,
|
|
@vchProjectName,
|
|
@vchSourceSafeINI,
|
|
@vchServerName,
|
|
@vchDatabaseName,
|
|
@vchLoginName,
|
|
@vchPassword
|
|
|
|
if @iReturn <> 0 GOTO E_OAError
|
|
|
|
exec @iReturn = master.dbo.sp_OAGetProperty @iObjectId, 'GetStreamObject', @iStreamObjectId OUT
|
|
|
|
if @iReturn <> 0 GOTO E_OAError
|
|
|
|
create table #ObjectList (id int identity, vchObjectlist varchar(255))
|
|
|
|
select @vchTempText = 'STUB'
|
|
while @vchTempText is not null
|
|
begin
|
|
exec @iReturn = master.dbo.sp_OAMethod @iStreamObjectId, 'GetStream', @iReturnValue OUT, @vchTempText OUT
|
|
if @iReturn <> 0 GOTO E_OAError
|
|
|
|
if (@vchTempText = '') set @vchTempText = null
|
|
if (@vchTempText is not null) insert into #ObjectList (vchObjectlist ) select @vchTempText
|
|
end
|
|
|
|
select vchObjectlist from #ObjectList order by id
|
|
end
|
|
|
|
CleanUp:
|
|
return
|
|
|
|
E_OAError:
|
|
exec dbo.dt_displayoaerror @iObjectId, @iReturn
|
|
goto CleanUp
|
|
|
|
|
|
|
|
GO
|