dbUpgrade2_0025-to-2_0026_mssqlserver.sql 884 B

123456789101112131415161718192021222324
  1. -- Licensed Materials - Property of IBM
  2. --
  3. -- BI and PM: CM
  4. --
  5. -- (C) Copyright IBM Corp. 2008, 2009
  6. --
  7. -- US Government Users Restricted Rights - Use, duplication or disclosure
  8. -- restricted by GSA ADP Schedule Contract with IBM Corp.
  9. -- Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
  10. -- Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
  11. CREATE PROCEDURE CMPARSECOPYIDS @QUERYID int, @GROUPID int, @SOURCEIDS image, @TARGETIDS image AS
  12. SET NOCOUNT ON
  13. DECLARE @SOURCEIMAGESIZE AS int
  14. DECLARE @CURPOS AS int
  15. SELECT @CURPOS=0
  16. SELECT @SOURCEIMAGESIZE = DATALENGTH(@SOURCEIDS)
  17. WHILE @CURPOS < @SOURCEIMAGESIZE
  18. BEGIN
  19. INSERT INTO #CMTMPCOPYIDS (QUERYID,GROUPID,SOURCECMID, TARGETCMID) SELECT @QUERYID, @GROUPID, CAST(SUBSTRING(@SOURCEIDS, @CURPOS+1, 4) AS int), CAST(SUBSTRING(@TARGETIDS, @CURPOS+1, 4) AS int)
  20. SELECT @CURPOS=@CURPOS+4
  21. END