is there a way to load all databases from the source SQL Server to the data lake as it is?
I tried to load each database with his tables but I am asking if there was a way to load all databases as it is to the data lake
One of the ways to load all databases from SQL to ADLG2 is by using Azure Data Factory
Follow the below procedure to load all databases from SQL to ADLG2:
Query
And give the following query: SELECT name, database_id, create_date
FROM sys.databases;
ForEach
activity and int its settings give Items as so it will fetch output of script activity @activity('Script1').output.resultSets[0].rows
lookup
activity, create and add linked service for database with dynamic valuesIn that dataset add Db name parameter
Noe send this parameter value to linked service properties as below
Lookup activity settings
SELECT table_Schema, TABLE_NAME, TABLE_CATALOG
FROM information_Schema.tables
WHERE TABLE_TYPE = 'BASE TABLE'sql
lookupOP
parameter with array
datatype and in execute pipeline pass the value to it as output of lookup as @activity('Lookup1').output.value
ForEach
activity and passthe parameter we created as itemsIn this dataset create parameters for database name, table name and schema name
now add these dynamic values to linked service properties and Table name, table schema
Copy activity source setting:
create parameters in sink dataset
now add these dynamic values to folder name, file name
Copy activity Sink settings
Output
creating folder of database name and in that folder loading tables of that particular database
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.