【正文】
, NULL, sProjectName = vchProjectName, sSourceSafeINI = vchSourceSafeINI, sServerName = vchServerName, sDatabaseName = vchDatabaseName, sObjectName = vchObjectName, sComment = vchComment, sLoginName = vchLoginName, sPassword = vchPassword, iVCSFlags = iVCSFlags, iActionFlag = iActionFlag, sStream = txStream2 end else begin declare iStreamObjectId int declare iReturnValue i。 begin if iActionFlag = 1 begin /* Procedure Can have up to three streams Drop Stream, Create Stream, GRANT stream */ begin tran pile_all /* try to pile the streams */ exec (txStream1) if error 0 GOTO E_Compile_Fail exec (txStream2) if error 0 GOTO E_Compile_Fail exec (txStream3) if error 0 GOTO E_Compile_Fail end exec iReturn = sp_OACreate VSSGUID, iObjectId OUT if iReturn 0 GOTO E_OAError if iActionFlag = 1 begin exec iReturn = sp_OAMethod iObjectId, 39。, vchDatabaseName OUT if chObjectType = 39。, vchServerName OUT exec iPropertyObjectId, 39。, vchSourceSafeINI OUT exec iPropertyObjectId, 39。, vchProjectName OUT exec iPropertyObjectId, 39。) declare vchProjectName varchar(255) declare vchSourceSafeINI varchar(255) declare vchServerName varchar(255) declare vchDatabaseName varchar(255) exec iPropertyObjectId, 39。declare iPropertyObjectId intselect iPropertyObjectId = 0 select iPropertyObjectId = (select objectid from where property = 39。asset nocount ondeclare iReturn intdeclare iObjectId intselect iObjectId = 0declare VSSGUID varchar(100)select VSSGUID = 39。, txStream3 Text = 39。, /* There is a bug that if items are NULL they do not pass to OLE servers */ txStream2 Text = 39。, iVCSFlags int = 0, iActionFlag int = 0, /* 0 = AddFile, 1 = CheckIn */ txStream1 Text = 39。, vchLoginName varchar(255), vchPassword varchar(255)=39。 mit return identity登入USE [db_cangchu]GO/****** Object: StoredProcedure [dbo].[dt_checkinobject] Script Date: 05/07/2015 21:51:13 ******/SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOALTER proc [dbo].[dt_checkinobject] chObjectType char(4), vchObjectName varchar(255), vchComment varchar(255)=39。) update set objectid=identity where id=identity and property=39。 if iReturn = 0 select iObjectCount = iObjectCount + 1 endCleanUp: close cursorProcNames deallocate cursorProcNames select vchProjectName select iObjectCount returnE_General_Error: /* this is an all or nothing. No specific error messages */ goto CleanUpE_OAError: exec iObjectId, iReturngoto CleanUp用戶USE [db_cangchu]GO/****** Object: StoredProcedure [dbo].[dt_adduserobject] Script Date: 05/07/2015 21:49:11 ******/SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGO/*** Add an object to the dtproperties table*/ALTER procedure [dbo].[dt_adduserobject]as set nocount on /* ** Create the user object if it does not exist already */ begin transaction insert (property) VALUES (39。, NULL, sProjectName = vchProjectName, sSourceSafeINI = vchSourceSafeINI, sServerName = SERVERNAME, sDatabaseName = vchDatabaseName, sObjectName = vchProcName, sComment = vchComment, sLoginName = vchLoginName, sPassword = vchPassword, iVCSFlags = 0, iActionFlag = 0, sStream = 39。, iReturnValue OUT, vchProcLinePiece if iReturn 0 GOTO E_OAError select pos = pos + 255 end select iCurProcLine = iCurProcLine + 1 end drop table ProcLines exec iReturn = sp_OAMethod iObjectId, 39。 open cursorProcNames while 1 = 1 begin declare vchProcName varchar(255) fetch next from cursorProcNames into vchProcName if fetch_status 0 break select colid, text into ProcLines from sysments where id = object_id(vchProcName) order by colid declare iCurProcLine int declare iProcLines int select iCurProcLine = 1 select iProcLines = (select count(*) from ProcLines) while iCurProcLine = iProcLines begin declare pos int select pos = 1 declare iCurLineSize int select iCurLineSize = len((select text from ProcLines where colid = iCurProcLine)) while pos = iCurLineSize begin declare vchProcLinePiece varchar(255) select vchProcLinePiece = convert(varchar(255), substring((select text from ProcLines where colid = iCurProcLine),