SHARE
TWEET

SQLCLR Stored Proc returns one result set of many XML files

SqlQuantumLeap Oct 7th, 2015 (edited) 274 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- This script is associated with the following DBA.StackExchange answer:
  2. -- http://dba.stackexchange.com/questions/117005/import-xml-files-into-sql-server-2012/117288#117288
  3. -- For more functions like this, please visit: http://SQLsharp.com
  4.  
  5. -- The Assembly below is compiled against .NET Framework version 2.0 so that it will work in SQL Server 2005 and
  6. -- newer (i.e. all versions that support SQLCLR).
  7.  
  8. /* -- CLEAN UP (if needed)
  9. USE [ {your_database_name} ];
  10. DROP PROCEDURE [dbo].[ReadXmlFiles];
  11. DROP ASSEMBLY [ImportXmlFiles];
  12.  
  13. USE [master];
  14. DROP LOGIN [MrXmlImporter];
  15. DROP ASYMMETRIC KEY [XmlImporterKey];
  16. */
  17.  
  18. SET ANSI_NULLS, ANSI_PADDING, ANSI_WARNINGS, ARITHABORT, CONCAT_NULL_YIELDS_NULL, QUOTED_IDENTIFIER ON;
  19.  
  20. -------------------------------------------------------------------------------------
  21. --                   ENABLE "CLR Integration" (ONLY IF NOT ALREADY ENABLED)
  22. -------------------------------------------------------------------------------------
  23. IF EXISTS(
  24.             SELECT *
  25.             FROM   sys.configurations sc
  26.             WHERE  sc.[name] = N'clr enabled'
  27.             AND    sc.[value_in_use] = 0
  28.         )
  29. BEGIN
  30.     PRINT 'Enabling "CLR Integration"...';
  31.     EXEC sp_configure N'clr enabled', 1;
  32.     RECONFIGURE;
  33. END;
  34. -------------------------------------------------------------------------------------
  35.  
  36.  
  37. -------------------------------------------------------------------------------------
  38. --                   SECURITY SETUP
  39. -------------------------------------------------------------------------------------
  40.  
  41. USE [master];
  42.  
  43. IF (NOT EXISTS(
  44.                SELECT *
  45.                FROM   sys.asymmetric_keys ak
  46.                WHERE  ak.name = N'XmlImporterKey'
  47.               )
  48.    )
  49. BEGIN
  50.  
  51.     -- STEP 1: Create an Assembly to be the source of the Asymmetric Key. Typically the Asymmetric Key is
  52.     --         created FROM the DLL, but that doesn't work well with Continuous Integration or Azure SQL Database.
  53.     PRINT N'Creating Assembly [TempXmlImporterKeySource]...';
  54.     CREATE ASSEMBLY [TempXmlImporterKeySource]
  55.     FROM 0x\
  56. 4D5A90000300000004000000FFFF0000B800000000000000400000000000000000000000000000000000000000000000000000000000000000000000800000000E1FBA0E00B409\
  57. CD21B8014CCD21546869732070726F6772616D2063616E6E6F742062652072756E20696E20444F53206D6F64652E0D0D0A2400000000000000504500004C010300AC9A14560000\
  58. 000000000000E00002210B010B00000C000000060000000000000E2A00000020000000400000000000100020000000020000040000000000000004000000000000000080000000\
  59. 0200000F590000030040850000100000100000000010000010000000000000100000000000000000000000BC2900004F00000000400000C0030000000000000000000000000000\
  60. 00000000006000000C000000842800001C000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000008000000000000\
  61. 0000000000082000004800000000000000000000002E74657874000000140A000000200000000C000000020000000000000000000000000000200000602E72737263000000C003\
  62. 00000040000000040000000E0000000000000000000000000000400000402E72656C6F6300000C0000000060000000020000001200000000000000000000000000004000004200\
  63. 000000000000000000000000000000F029000000000000480000000200050024210000600700000900000000000000000000000000000050200000800000000000000000000000\
  64. 00000000000000000000000000000000000000000000000034AE26AC27873A3408A2B07178D66198EC5C59FC313185318F1FE4EEC586EFB4CCB825D763AB4C1C4B48259009CE61\
  65. 61E92D5600D36D5C5FC21981872168CC2640582D2EAC3DEB4012F09688AF1ED7D44E75E77A3B8FCF841A943883CE515A1413C66AEA970FD8B2D56222F409FB8DC5471CE9FC87F1\
  66. 1590FD03D4604C1AE485133003003D000000010000110F00281000000A72010000700F01281100000A2D03162B0117281200000A0B160C2B1307089A0A281300000A066F140000\
  67. 0A0817580C08078E6932E72A1E02281500000A2A00000042534A4201000100000000000C00000076322E302E35303732370000000005006C00000028020000237E000094020000\
  68. F402000023537472696E67730000000088050000100000002355530098050000100000002347554944000000A8050000B801000023426C6F620000000000000002000001471502\
  69. 000900000000FA2533001600000100000017000000020000000200000002000000150000000D00000001000000010000000200000000000A0001000000000006003C0035000A00\
  70. 64004F000A006E004F000A00B00095000600DE00CC000600F500CC0006001201CC0006003101CC0006004A01CC0006006301CC0006007E01CC0006009901CC000600B201CC0006\
  71. 00CB01CC000600FB01E8013F000F02000006003E021E0206005E021E020A007C0295000600B102A7020600BB02A7020A00D10295000A00DC029500000000000100000000000100\
  72. 0100010010001D000000050001000100D02000000000960079000A0001001921000000008618860012000300000001008C0000000200C200210086001200290086002900310086\
  73. 002900390086002900410086002900490086002900510086002900590086002900610086002900690086002900710086002900790086002E008900860034009100860012009900\
  74. 8600120011009202E00019009C02E400A100C802E800B100E402F100B900ED02290009008600120020007B00DB0024000B0016002E0033003B012E001B001F012E0023001F012E\
  75. 002B0025012E001300FD002E003B004F012E0043001F012E005B0078012E00630085012E006B008E012E0073009701F6000480000001000000000000000100000039001D000000\
  76. 02000000000000000000000001002C0000000000020000000000000000000000010043000000000000000000003C4D6F64756C653E00496D706F7274586D6C46696C65732E646C\
  77. 6C00496D706F7274586D6C46696C6573006D73636F726C69620053797374656D004F626A6563740053797374656D2E446174610053797374656D2E446174612E53716C54797065\
  78. 730053716C537472696E670053716C426F6F6C65616E0052656164586D6C46696C6573002E63746F720046696C6550617468004D6963726F736F66742E53716C5365727665722E\
  79. 5365727665720053716C4661636574417474726962757465005265637572736976650053797374656D2E5265666C656374696F6E00417373656D626C795469746C654174747269\
  80. 6275746500417373656D626C794465736372697074696F6E41747472696275746500417373656D626C79436F6E66696775726174696F6E41747472696275746500417373656D62\
  81. 6C79436F6D70616E7941747472696275746500417373656D626C7950726F6475637441747472696275746500417373656D626C79436F7079726967687441747472696275746500\
  82. 417373656D626C7954726164656D61726B41747472696275746500417373656D626C7943756C7475726541747472696275746500417373656D626C7956657273696F6E41747472\
  83. 696275746500417373656D626C7946696C6556657273696F6E4174747269627574650053797374656D2E446961676E6F73746963730044656275676761626C6541747472696275\
  84. 746500446562756767696E674D6F6465730053797374656D2E52756E74696D652E436F6D70696C6572536572766963657300436F6D70696C6174696F6E52656C61786174696F6E\
  85. 734174747269627574650052756E74696D65436F6D7061746962696C6974794174747269627574650053716C50726F636564757265417474726962757465006765745F56616C75\
  86. 65006765745F4973547275650053797374656D2E494F004469726563746F7279005365617263684F7074696F6E0047657446696C65730053716C436F6E746578740053716C5069\
  87. 7065006765745F506970650053656E64000000000B2A002E0078006D006C00000000003049A0EE77E11946942701229B16E87D0008B77A5C561934E089070002011109110D0320\
  88. 000112010001005408074D617853697A65F4010000042001010E052001011141042001010880A00024000004800000940000000602000000240000525341310004000001000100\
  89. 89F976DC6DD8D82E3854DB8B79560530267CB164C8E5EB40D6FAD8D6C64AA2A76E360B722A325E72A72D579CD0275667E3D49EB22273E3999619F8C879735C31F62AC761B5F631\
  90. 60ACD0FABA7497B3261A8994ABC79C1E35237A3AAB7681EF7ADED23F900A9F61292D580652BBEE40BFAB3F9381619A400AAB4473ED766F7CDD04010000000320000E0320000208\
  91. 00031D0E0E0E1155040000125D0607030E1D0E082101001C576861742043616E20596F7520446F20576974682053514C434C523F00000501000000001501001053716C20517561\
  92. 6E74756D204C65617000001301000E496D706F7274586D6C46696C6573000028010023436F707972696768742028632920323031352053716C205175616E74756D204C65617000\
  93. 000C010007312E302E302E3000000801000200000000000801000800000000001E01000100540216577261704E6F6E457863657074696F6E5468726F777301000000000000AC9A\
  94. 145600000000020000001C010000A0280000A00A0000525344537203C23562F1D94AAE10EF660624546301000000633A5C54454D505C537461636B4F766572666C6F775C496D70\
  95. 6F7274586D6C46696C65735C496D706F7274586D6C46696C65735C6F626A5C52656C656173655C496D706F7274586D6C46696C65732E7064620000000000000000000000000000\
  96. 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
  97. 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
  98. 00000000000000000000000000000000000000000000E42900000000000000000000FE290000002000000000000000000000000000000000000000000000F02900000000000000\
  99. 00000000005F436F72446C6C4D61696E006D73636F7265652E646C6C0000000000FF25002000100000000000000000000000000000000000000000000000000000000000000000\
  100. 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
  101. 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
  102. 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
  103. 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
  104. 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
  105. 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
  106. 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100100000001800008000000000000000000000000000\
  107. 000100010000003000008000000000000000000000000000000100000000004800000058400000640300000000000000000000640334000000560053005F005600450052005300\
  108. 49004F004E005F0049004E0046004F0000000000BD04EFFE00000100000001000000000000000100000000003F0000000000000004000000020000000000000000000000000000\
  109. 00440000000100560061007200460069006C00650049006E0066006F00000000002400040000005400720061006E0073006C006100740069006F006E00000000000000B004C402\
  110. 0000010053007400720069006E006700460069006C00650049006E0066006F000000A0020000010030003000300030003000340062003000000044001100010043006F006D0070\
  111. 0061006E0079004E0061006D00650000000000530071006C0020005100750061006E00740075006D0020004C006500610070000000000064001D000100460069006C0065004400\
  112. 650073006300720069007000740069006F006E000000000057006800610074002000430061006E00200059006F007500200044006F00200057006900740068002000530051004C\
  113. 0043004C0052003F0000000000300008000100460069006C006500560065007200730069006F006E000000000031002E0030002E0030002E003000000048001300010049006E00\
  114. 7400650072006E0061006C004E0061006D006500000049006D0070006F007200740058006D006C00460069006C00650073002E0064006C006C00000000006C00240001004C0065\
  115. 00670061006C0043006F007000790072006900670068007400000043006F0070007900720069006700680074002000280063002900200032003000310035002000530071006C00\
  116. 20005100750061006E00740075006D0020004C0065006100700000005000130001004F0072006900670069006E0061006C00460069006C0065006E0061006D006500000049006D\
  117. 0070006F007200740058006D006C00460069006C00650073002E0064006C006C000000000040000F000100500072006F0064007500630074004E0061006D006500000000004900\
  118. 6D0070006F007200740058006D006C00460069006C006500730000000000340008000100500072006F006400750063007400560065007200730069006F006E00000031002E0030\
  119. 002E0030002E003000000038000800010041007300730065006D0062006C0079002000560065007200730069006F006E00000031002E0030002E0030002E003000000000000000\
  120. 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000C0000\
  121. 00103A0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
  122. 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
  123. 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
  124. 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
  125. 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
  126. 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
  127. 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
  128. 0000000000000000
  129.     WITH PERMISSION_SET = SAFE;
  130.  
  131.     -- STEP 2: Create the Asymmetric Key from the Assembly we just created
  132.     PRINT N'Creating Asymmetric Key [XmlImporterKey]...';
  133.     CREATE ASYMMETRIC KEY [XmlImporterKey]
  134.         FROM ASSEMBLY [TempXmlImporterKeySource];
  135.  
  136.     -- STEP 3: DROP the Assembly as we don't need it anymore
  137.     PRINT N'Dropping Assembly [TempXmlImporterKeySource]...';
  138.     DROP ASSEMBLY [TempXmlImporterKeySource];
  139.  
  140.     -- STEP 4: Create a Login from the Asymmetric Key we just created
  141.     PRINT N'Creating Login [MrXmlImporter]...';
  142.     CREATE LOGIN [MrXmlImporter] FROM ASYMMETRIC KEY [XmlImporterKey];
  143.  
  144.     -- STEP 5: GRANT the appropriate permission. Note, this does not allow the Assembly to be set to UNSAFE!
  145.     PRINT N'Granting permission to [MrXmlImporter]...';
  146.     GRANT EXTERNAL ACCESS ASSEMBLY TO [MrXmlImporter];
  147. END;
  148.  
  149.  
  150. -------------------------------------------------------------------------------------
  151. --                   CREATE OBJECTS
  152. -------------------------------------------------------------------------------------
  153. SET ANSI_NULLS, ANSI_PADDING, ANSI_WARNINGS, ARITHABORT, CONCAT_NULL_YIELDS_NULL, QUOTED_IDENTIFIER ON;
  154.  
  155. USE [ {your_database_name} ];
  156. GO
  157. PRINT N'Creating [ImportXmlFiles]...';
  158. GO
  159. CREATE ASSEMBLY [ImportXmlFiles]
  160.     AUTHORIZATION [dbo]
  161.     FROM 0x\
  162. 4D5A90000300000004000000FFFF0000B800000000000000400000000000000000000000000000000000000000000000000000000000000000000000800000000E1FBA0E00B409\
  163. CD21B8014CCD21546869732070726F6772616D2063616E6E6F742062652072756E20696E20444F53206D6F64652E0D0D0A2400000000000000504500004C010300964315560000\
  164. 000000000000E00002210B010B000010000000080000000000000E2F00000020000000400000000000100020000000020000040000000000000004000000000000000080000000\
  165. 020000241A0000030040850000100000100000000010000010000000000000100000000000000000000000BC2E00004F0000000040000070050000000000000000000000000000\
  166. 00000000006000000C000000842D00001C000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000008000000000000\
  167. 0000000000082000004800000000000000000000002E74657874000000140F0000002000000010000000020000000000000000000000000000200000602E727372630000007005\
  168. 0000004000000006000000120000000000000000000000000000400000402E72656C6F6300000C0000000060000000020000001800000000000000000000000000004000004200\
  169. 000000000000000000000000000000F02E000000000000480000000200050070220000140B00000900000000000000000000000000000050200000800000000000000000000000\
  170. 0000000000000000000000000000000000000000000000002C6976D45BA3C4011E62AAB83B414C0EE75D8F93BE58B63918963D14A6B9A9EB41FF38002C302D105E0EAC22027ABD\
  171. 6E1AF91690E4A75BAB28632A70B46BC559168E5DBAC1FCD0E29480AD997AFA12D8AF6BB7622565F38FF24BC03D0C1BEE9358862505688CD13C77E12ACC902289290655AF899232\
  172. 059438931BE3ABB440BE133005008C01000001000011731100000A0A1C8D16000001130411041672010000701F161F0A6A731200000AA211041772150000701F161F0A6A731200\
  173. 000AA211041872290000701F161F0A6A731200000AA2110419723D0000701E731300000AA211041A72510000701F161F0A6A731200000AA211041B72650000701E731300000AA2\
  174. 1104731400000A0B281500000A076F1600000A0F00281700000A72790000700F01281800000A2D03162B0117281900000A130516130638C3000000110511069A0C06086F1A0000\
  175. 0A0672850000706F1B00000A741E0000010D07160972990000706F1B00000A6F1C00000A6F1D00000A07170972B10000706F1B00000A6F1C00000A6F1D00000A07180972C90000\
  176. 706F1B00000A6F1C00000A6F1D00000A07190972E10000706F1B00000A6F1C00000A281E00000A6F1F00000A071A0972F90000706F1B00000A6F1C00000A6F1D00000A071B0972\
  177. 110100706F1B00000A6F1C00000A281E00000A6F1F00000A281500000A076F2000000A110617581306110611058E693F32FFFFFF281500000A6F2100000A2A1E02282200000A2A\
  178. 42534A4201000100000000000C00000076322E302E35303732370000000005006C000000C0020000237E00002C030000D803000023537472696E677300000000040700002C0100\
  179. 00235553003008000010000000234755494400000040080000D402000023426C6F620000000000000002000001471502000900000000FA253300160000010000001F0000000200\
  180. 00000200000002000000220000000E00000001000000010000000300000000000A0001000000000006003C0035000A0064004F000A006E004F000A00B00095000600DE00CC0006\
  181. 00F500CC0006001201CC0006003801CC0006005701CC0006007001CC0006008901CC000600A401CC000600BF01CC000600D801CC000600F101CC00060021020E02430035020000\
  182. 0600640244020600840244020A00A20295000E00C302B8020A00CF0295000A00DB0243000A00E50295000A00F30295000A00FE02950006003F0335030600490335030E006403B8\
  183. 020E007D03B8020600A00335000000000001000000000001000100010010001D000000050001000100D02000000000960079000A00010068220000000086188600120003000000\
  184. 01008C0000000200C20021008600120029008600290031008600290039008600290041008600290049008600290051008600290059008600290061008600290069008600290071\
  185. 0086002900790086002900810086002E00910086003400990086001200A10086001200A90086001200B1008600E000B1008600E800C1008600EF00C9000603F600D1000F03FB00\
  186. 11002003010119002A030501D90056030901A9005F032900E9006C031201E90088030101C10096031801F900A8031E01C100B0032301D100B903FB00D100C80312000900860012\
  187. 0020008300DB0024000B0016002E00330022022E001B0096012E002300B5012E002B001C022E00130039012E003B0056022E0043006A022E004B001C022E00630093022E006B00\
  188. A0022E007300A9022E007B00B20229010480000001000000000000000100000039001D00000002000000000000000000000001002C000000000002000000000000000000000001\
  189. 004300000000000200000000000000000000000100B8020000000000000000003C4D6F64756C653E00496D706F7274586D6C46696C65732E646C6C00496D706F7274586D6C4669\
  190. 6C6573006D73636F726C69620053797374656D004F626A6563740053797374656D2E446174610053797374656D2E446174612E53716C54797065730053716C537472696E670053\
  191. 716C426F6F6C65616E0052656164586D6C46696C6573002E63746F720046696C6550617468004D6963726F736F66742E53716C5365727665722E5365727665720053716C466163\
  192. 6574417474726962757465005265637572736976650053797374656D2E5265666C656374696F6E00417373656D626C795469746C6541747472696275746500417373656D626C79\
  193. 4465736372697074696F6E41747472696275746500417373656D626C79496E666F726D6174696F6E616C56657273696F6E41747472696275746500417373656D626C79436F6E66\
  194. 696775726174696F6E41747472696275746500417373656D626C79436F6D70616E7941747472696275746500417373656D626C7950726F64756374417474726962757465004173\
  195. 73656D626C79436F7079726967687441747472696275746500417373656D626C7954726164656D61726B41747472696275746500417373656D626C7943756C7475726541747472\
  196. 696275746500417373656D626C7956657273696F6E41747472696275746500417373656D626C7946696C6556657273696F6E4174747269627574650053797374656D2E44696167\
  197. 6E6F73746963730044656275676761626C6541747472696275746500446562756767696E674D6F6465730053797374656D2E52756E74696D652E436F6D70696C65725365727669\
  198. 63657300436F6D70696C6174696F6E52656C61786174696F6E734174747269627574650052756E74696D65436F6D7061746962696C6974794174747269627574650053716C5072\
  199. 6F6365647572654174747269627574650053797374656D2E586D6C00586D6C446F63756D656E740053716C4D657461446174610053716C4462547970650053716C446174615265\
  200. 636F72640053716C436F6E746578740053716C50697065006765745F506970650053656E64526573756C74735374617274006765745F56616C7565006765745F49735472756500\
  201. 53797374656D2E494F004469726563746F7279005365617263684F7074696F6E0047657446696C6573004C6F616400586D6C4E6F64650053656C65637453696E676C654E6F6465\
  202. 00586D6C456C656D656E74006765745F496E6E65725465787400536574537472696E6700436F6E7665727400546F496E74333200536574496E7433320053656E64526573756C74\
  203. 73526F770053656E64526573756C7473456E6400000013520030003000300030003000300031003000001352003000300030003000300030003200300000135200300030003000\
  204. 3000300030003300300000135200300030003000300030003000340030000013520030003000300030003000300035003000001352003000300030003000300030003600300000\
  205. 0B2A002E0078006D006C0000132F002F00520030003000300030003000300000172E002F0052003000300030003000300030003100300000172E002F0052003000300030003000\
  206. 300030003200300000172E002F0052003000300030003000300030003300300000172E002F0052003000300030003000300030003400300000172E002F00520030003000300030\
  207. 00300030003500300000172E002F0052003000300030003000300030003600300000000000EED4322584B92148A94F09B75969A1EF0008B77A5C561934E089070002011109110D\
  208. 0320000112010001005408074D617853697A65F4010000042001010E052001011145042001010880A0002400000480000094000000060200000024000052534131000400000100\
  209. 010089F976DC6DD8D82E3854DB8B79560530267CB164C8E5EB40D6FAD8D6C64AA2A76E360B722A325E72A72D579CD0275667E3D49EB22273E3999619F8C879735C31F62AC761B5\
  210. F63160ACD0FABA7497B3261A8994ABC79C1E35237A3AAB7681EF7ADED23F900A9F61292D580652BBEE40BFAB3F9381619A400AAB4473ED766F7CDD0401000000072003010E115D\
  211. 0A062002010E115D062001011D125904000012690520010112610320000E032000020800031D0E0E0E117105200112750E05200201080E040001080E0520020108080F07071255\
  212. 12610E12791D12591D0E085C01005753514C434C522066756E6374696F6E20666F722053514C20536572766572203230303520616E64206E657765722E205365652050726F7065\
  213. 7274696573202D3E2044657461696C7320666F72206D6F726520696E666F2E00001E010019687474703A2F2F53716C5175616E74756D4C6561702E636F6D000066010061687474\
  214. 703A2F2F6462612E737461636B65786368616E67652E636F6D2F7175657374696F6E732F3131373030352F696D706F72742D786D6C2D66696C65732D696E746F2D73716C2D7365\
  215. 727665722D323031322F3131373238382331313732383800000501000000003301002E53716C205175616E74756D204C656170202820687474703A2F2F53716C5175616E74756D\
  216. 4C6561702E636F6D202900001301000E496D706F7274586D6C46696C6573000028010023436F7079726967687420C2A920323031352053716C205175616E74756D204C6561702E\
  217. 00000C010007312E302E302E3000000801000200000000000801000800000000001E01000100540216577261704E6F6E457863657074696F6E5468726F77730100000000000000\
  218. 9643155600000000020000001C010000A02D0000A00F00005253445333D0E9EFA90C4E41928127F8161DC90607000000633A5C54454D505C537461636B4F766572666C6F775C49\
  219. 6D706F7274586D6C46696C65735C496D706F7274586D6C46696C65735C6F626A5C52656C656173655C496D706F7274586D6C46696C65732E706462000000000000000000000000\
  220. 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
  221. 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
  222. 000000000000000000000000000000000000000000000000E42E00000000000000000000FE2E0000002000000000000000000000000000000000000000000000F02E0000000000\
  223. 000000000000005F436F72446C6C4D61696E006D73636F7265652E646C6C0000000000FF2500200010000000000000000000000000000000000000000000000000000000000000\
  224. 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
  225. 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
  226. 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
  227. 0000000000000001001000000018000080000000000000000000000000000001000100000030000080000000000000000000000000000001000000000048000000584000001405\
  228. 00000000000000000000140534000000560053005F00560045005200530049004F004E005F0049004E0046004F0000000000BD04EFFE0000010000000100000000000000000000\
  229. 0000003F000000000000000400000002000000000000000000000000000000440000000100560061007200460069006C00650049006E0066006F00000000002400040000005400\
  230. 720061006E0073006C006100740069006F006E00000000000000B00474040000010053007400720069006E006700460069006C00650049006E0066006F00000050040000010030\
  231. 00300030003000300034006200300000004C001A00010043006F006D006D0065006E0074007300000068007400740070003A002F002F00530071006C005100750061006E007400\
  232. 75006D004C006500610070002E0063006F006D00000080002F00010043006F006D00700061006E0079004E0061006D00650000000000530071006C0020005100750061006E0074\
  233. 0075006D0020004C0065006100700020002800200068007400740070003A002F002F00530071006C005100750061006E00740075006D004C006500610070002E0063006F006D00\
  234. 2000290000000000D80058000100460069006C0065004400650073006300720069007000740069006F006E0000000000530051004C0043004C0052002000660075006E00630074\
  235. 0069006F006E00200066006F0072002000530051004C00200053006500720076006500720020003200300030003500200061006E00640020006E0065007700650072002E002000\
  236. 5300650065002000500072006F00700065007200740069006500730020002D003E002000440065007400610069006C007300200066006F00720020006D006F0072006500200069\
  237. 006E0066006F002E000000300008000100460069006C006500560065007200730069006F006E000000000031002E0030002E0030002E003000000048001300010049006E007400\
  238. 650072006E0061006C004E0061006D006500000049006D0070006F007200740058006D006C00460069006C00650073002E0064006C006C00000000006C00230001004C00650067\
  239. 0061006C0043006F007000790072006900670068007400000043006F0070007900720069006700680074002000A900200032003000310035002000530071006C00200051007500\
  240. 61006E00740075006D0020004C006500610070002E00000000005000130001004F0072006900670069006E0061006C00460069006C0065006E0061006D006500000049006D0070\
  241. 006F007200740058006D006C00460069006C00650073002E0064006C006C000000000040000F000100500072006F0064007500630074004E0061006D0065000000000049006D00\
  242. 70006F007200740058006D006C00460069006C006500730000000000E80062000100500072006F006400750063007400560065007200730069006F006E00000068007400740070\
  243. 003A002F002F006400620061002E0073007400610063006B00650078006300680061006E00670065002E0063006F006D002F007100750065007300740069006F006E0073002F00\
  244. 3100310037003000300035002F0069006D0070006F00720074002D0078006D006C002D00660069006C00650073002D0069006E0074006F002D00730071006C002D007300650072\
  245. 007600650072002D0032003000310032002F003100310037003200380038002300310031003700320038003800000038000800010041007300730065006D0062006C0079002000\
  246. 560065007200730069006F006E00000031002E0030002E0030002E0030000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
  247. 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
  248. 0000000000000000000000000000000000000000000000000000000000000000000000000000002000000C000000103F0000000000000000000000000000000000000000000000\
  249. 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
  250. 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
  251. 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
  252. 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
  253. 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
  254. 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
  255. 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
  256. WITH PERMISSION_SET = EXTERNAL_ACCESS;
  257. GO
  258.  
  259. PRINT N'Creating [dbo].[ReadXmlFiles]...';
  260. GO
  261. CREATE PROCEDURE [dbo].[ReadXmlFiles]
  262. (
  263.     @FilePath NVARCHAR(500),
  264.     @Recursive BIT = 0
  265. )
  266. AS EXTERNAL NAME [ImportXmlFiles].[ImportXmlFiles].[ReadXmlFiles]
  267. GO
  268. -------------------------------------------------------------------------------------
  269.  
  270. -- For more functions like this, please visit: http://SQLsharp.com
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top