Search
 
SCRIPT & CODE EXAMPLE
 

SQL

importing multiple xml files in azure sql database

CREATE PROCEDURE [BI].[XML_IMPORT_AND_SPLIT] AS
BEGIN
 DECLARE @name_of_file varchar(8000)
 DECLARE cursor_file_names CURSOR FAST_FORWARD
 FOR SELECT NAME_OF_FILE FROM BI.BLOB_FILE_NAME WHERE NAME_OF_FILE LIKE '%.xml'
 OPEN cursor_file_names
 FETCH NEXT FROM cursor_file_names into @name_of_file
 WHILE @@FETCH_STATUS = 0 
 BEGIN 
 EXEC
 (
 'INSERT INTO [BI].[XML_IMPORT](XML_DATA) 
 SELECT CAST(BulkColumn AS XML)
 FROM OPENROWSET
 (
 BULK ''MyStorage/MainFolder/' + @name_of_file + ''',
 DATA_SOURCE = ''EDS_AzureBlobStorage'', 
 SINGLE_BLOB
 ) as XML_IMPORT'
 )
 FETCH NEXT FROM cursor_file_names into @name_of_file
 END
 DEALLOCATE cursor_file_names
Comment

PREVIOUS NEXT
Code Example
Sql :: How to query data in many to many relationship in flask sql alchemy 
Sql :: oracle index hint multiple tables example 
Sql :: sql queries for interview 
Sql :: add new column in table 
Sql :: python and mysql connectivity 
Sql :: primary key in sql 
Sql :: in operator in sql 
Sql :: subquery in Update 
Sql :: what is rownum in oracle 
Sql :: how to query a db sqlite3 database in django python 
Sql :: join multiple tables 
Sql :: sql first day quarter 
Sql :: fatal database postgres does not exist 
Sql :: deletar banco de dados mysql 
Sql :: sql query by rahuldev 
Sql :: example of sql querry result sepapreted by comma 
Csharp :: ms crm set state request dynamics 365 set state request 
Csharp :: c# get executable path 
Csharp :: c# string equals ignore case 
Csharp :: c# get pc ip address 
Csharp :: c# bytes to string 
Csharp :: c# check file exists 
Csharp :: set width of rect transform unity 
Csharp :: c# list to string 
Csharp :: c# foreach enum 
Csharp :: current directory in sln file c# 
Csharp :: C# previous method 
Csharp :: C# save pdf stream to file 
Csharp :: c# empty IEnumerable 
Csharp :: unity string format time 
ADD CONTENT
Topic
Content
Source link
Name
5+4 =