- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Move data from locally installed SQL Server to Azure SQL in Nifi
- Labels:
-
Apache NiFi
-
NiFi Registry
Created on 08-13-2023 03:48 AM - edited 08-13-2023 08:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
My task is to move data from my locally installed SQL server (16.0) to Azure SQL (12.0) hosted on my Azure subscription.
So far, I have used ExecuteSQL processor to run my select query from SQL Server and it returns me the rows successfully. I have created a Database Polling Connection Service which connect to my SQL Server.
After fetching the rows, I am using PutDatabaseRecord processor to insert the fetched rows into Azure SQL but its showing me error that "use statement is not supported to switch between databases". Note that the Database Polling Connection Service is different for PutDatabaseRecord where I have mentioned connection string of my Azure SQL.
Please if anyone can give feedback on this issue and suggest any workaround.
Created 08-14-2023 05:54 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Kiranq No, you do not have to use the USE statement. Some things to consider:
- Make sure each DBCP is configured correctly with the right schema or namespace if possible in the confIguration or connection string.
- You can also make sure the schema or namespace above your table is included in the processor configuration. For example in PutDatabaseRecord you will find Schema Name in the properties.
- It could also be done in the sql statement without a specific use statement like select * from default.tablename; assuming your user has access to this default namespace with the tablname.
Created 08-13-2023 07:20 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Should I be using "use statement" in my sql select query?
Created 08-14-2023 05:54 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Kiranq No, you do not have to use the USE statement. Some things to consider:
- Make sure each DBCP is configured correctly with the right schema or namespace if possible in the confIguration or connection string.
- You can also make sure the schema or namespace above your table is included in the processor configuration. For example in PutDatabaseRecord you will find Schema Name in the properties.
- It could also be done in the sql statement without a specific use statement like select * from default.tablename; assuming your user has access to this default namespace with the tablname.
Created 08-17-2023 04:49 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks. It was an issue with the connection string. It was pointing to another database while my processor was inserting into another database.
