Produced by Araxis Merge on 3/27/2018 2:07:02 PM Eastern Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | BMS_v2.4_Code.zip\BMS_v2.4_Code\Database\BMSv2Updates\2.1.6.3\Reports | DROP_CREATE_BMS_DW_usp_GetVisnsByRegions1.sql | Wed Mar 21 14:51:00 2018 UTC |
| 2 | BMS_v2.4_Code.zip\BMS_v2.4_Code\Database\BMSv2Updates\2.1.6.3\Reports | DROP_CREATE_BMS_DW_usp_GetVisnsByRegions1.sql | Mon Mar 26 14:23:47 2018 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 196 |
| Changed | 1 | 2 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| Whitespace | |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
| 1 | USE [BMS_D W] | |
| 2 | GO | |
| 3 | ||
| 4 | /****** Ob ject: Sto redProcedu re [dbo].[ usp_GetVis nsByRegion s1] Scr ipt Date: 6/14/2016 9:20:53 AM ******/ | |
| 5 | DROP PROCE DURE [dbo] .[usp_GetV isnsByRegi ons1] | |
| 6 | GO | |
| 7 | ||
| 8 | /****** Ob ject: Sto redProcedu re [dbo].[ usp_GetVis nsByRegion s1] Scr ipt Date: 6/14/2016 9:20:53 AM ******/ | |
| 9 | SET ANSI_N ULLS ON | |
| 10 | GO | |
| 11 | ||
| 12 | SET QUOTED _IDENTIFIE R ON | |
| 13 | GO | |
| 14 | ||
| 15 | ||
| 16 | --exec usp _GetVisnsB yRegions @ USER_NAME= N' DNS . URL \bms_svc_s qa',@REGIO N_EXTENSIO NS=N'37483 721-6A2E-4 10D-9182-2 ADAEF79141 D,3F5AEAE3 -46E6-4BB7 -88F8-CF40 F75D3C95,9 AD81810-79 F1-4741-9B D8-4DF3A88 2116C,5163 7814-570E- 4818-893F- 104EA1179A 2C',@VISN_ EXTENSION= NULL | |
| 17 | CREATE PRO CEDURE [db o].[usp_Ge tVisnsByRe gions1] | |
| 18 | @U SER_NAME N VARCHAR(10 0), | |
| 19 | @R EGION_EXTE NSIONS NVA RCHAR(MAX) , | |
| 20 | @V ISN_EXTENS ION nvarch ar(250) = NULL | |
| 21 | AS | |
| 22 | BEGIN | |
| 23 | ||
| 24 | DE CLARE @SQL _SELECT NV ARCHAR(400 0), @SQL_W HERE NVARC HAR(4000), @SQL_ORDE R_BY NVARC HAR(4000), @SQL NVAR CHAR(4000) | |
| 25 | ||
| 26 | -- create tem porary REG ION table | |
| 27 | CR EATE TABLE #TBL_REGI ON | |
| 28 | ( | |
| 29 | EXT unique identifier PRIMARY K EY | |
| 30 | ) | |
| 31 | ||
| 32 | -- create pe rmission t able | |
| 33 | CR EATE TABLE #PERMISSI ON | |
| 34 | ( | |
| 35 | D IM_ORGANIZ ATION_ID I NT, | |
| 36 | D IM_WARD_ID INT | |
| 37 | ) | |
| 38 | ||
| 39 | --inse rt permiss ion for th e user | |
| 40 | INSERT INTO #PER MISSION | |
| 41 | SELE CT * FROM dbo.ufn_Ge tPermissio nByUserNam e(@USER_NA ME) | |
| 42 | CREATE NONCLUSTE RED INDEX [DIM_ORGAN IZATION_ID ] ON #PERM ISSION ([D IM_ORGANIZ ATION_ID] ASC) | |
| 43 | WITH ( | |
| 44 | PAD_INDEX = OFF, | |
| 45 | STATISTIC S_NORECOMP UTE = OFF , | |
| 46 | SORT_IN_T EMPDB = OF F, | |
| 47 | IGNORE_DU P_KEY = OF F, | |
| 48 | DROP_EXIS TING = OFF , | |
| 49 | ONLINE = OFF, | |
| 50 | ALLOW_ROW _LOCKS = ON, | |
| 51 | ALLOW_PAG E_LOCKS = ON) | |
| 52 | CREATE NONCLUSTE RED INDEX DIM_WARD_I D ON #PERM ISSION (DI M_WARD_ID ASC) | |
| 53 | WITH ( | |
| 54 | PAD_INDEX = OFF, | |
| 55 | STATISTIC S_NORECOMP UTE = OFF , | |
| 56 | SORT_IN_T EMPDB = OF F, | |
| 57 | IGNORE_DU P_KEY = OF F, | |
| 58 | DROP_EXIS TING = OFF , | |
| 59 | ONLINE = OFF, | |
| 60 | ALLOW_ROW _LOCKS = ON, | |
| 61 | ALLOW_PAG E_LOCKS = ON) ; | |
| 62 | ||
| 63 | IN SERT INTO #TBL_REGIO N(EXT) | |
| 64 | SE LECT CONVE RT(uniquei dentifier, VALUE) FR OM dbo.ufn _Split(@RE GION_EXTEN SIONS, ',' ) | |
| 65 | ||
| 66 | DE CLARE @DIM _ORGANIZAT ION_TYPE_I D int | |
| 67 | SE T @DIM_ORG ANIZATION_ TYPE_ID = (SELECT ID | |
| 68 | FR OM DIM_ORG ANIZATION_ TYPE | |
| 69 | WH ERE CODE=' VISN') | |
| 70 | ||
| 71 | SE T @SQL_SEL ECT = 'SEL ECT DISTIN CT VISN.SO URCE_ID AS SOURCE_ID , VISN.ID, VISN.NAME AS NAME, cast(VISN. CODE as in t) as CODE | |
| 72 | FR OM DIM_ORG ANIZATION AS VISN | |
| 73 | INNE R JOIN | |
| 74 | ( | |
| 75 | #PERMI SSION P IN NER JOIN D IM_ORGANIZ ATION AS F ACILITY ON FACILITY. ID = P.DIM _ORGANIZAT ION_ID | |
| 76 | INNER JOIN DIM_O RGANIZATIO N AS VISTA _SITE ON F ACILITY.DI M_ORGANIZA TION_ID = VISTA_SITE .ID | |
| 77 | ) ON VISN.ID = VISTA_SIT E.DIM_ORGA NIZATION_I D' | |
| 78 | ||
| 79 | SET @S QL_WHERE = ' WHERE V ISN.DIM_OR GANIZATION _TYPE_ID = ' + CAST( @DIM_ORGAN IZATION_TY PE_ID AS v archar) + ' | |
| 80 | AND VIS N.DIM_ORGA NIZATION_I D in (SELE CT ID FROM DIM_ORGAN IZATION WH ERE SOURCE _ID IN (SE LECT EXT F ROM #TBL_R EGION))' | |
| 81 | ||
| 82 | IF @VISN_EXT ENSION IS NOT NULL | |
| 83 | SET @ SQL_WHERE = @SQL_WHE RE + ' AND VISN.SOUR CE_ID = '' ' + @VISN_ EXTENSION + '''' | |
| 84 | ||
| 85 | SET @S QL_ORDER_B Y = ' ORDE R BY cast( VISN.CODE as int)' | |
| 86 | ||
| 87 | SET @S QL = @SQL_ SELECT + @ SQL_WHERE + @SQL_ORD ER_BY | |
| 88 | ||
| 89 | EX ECUTE sp_e xecutesql @SQL | |
| 90 | ||
| 91 | DR OP TABLE # PERMISSION | |
| 92 | DR OP TABLE # TBL_REGION | |
| 93 | ||
| 94 | END | |
| 95 | ||
| 96 | ||
| 97 | GO | |
| 98 | ||
| 99 |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.