Implementation of SQL Data Export Service in c# - c#

I'm new to Azure, I want to know about how we can implement SQL Data Export Service in c#.
my actual problem is "I am using C#.net to implement some web services and also use SQL azure as database for that services. So there each day i want to check whether there is any updation in my database. If there is an updation then i want to read only that updated data from my sql azure database and load that datainto some another sql database(both SQL Server and SQL Azure)". So i want to implement this function as windows azure worker role. So each and every day these worker role be executed. How i can implement that entire operation using c#.net.
If anyone know the solution please help me. Thanks

For that you will have to create a "Worker Role", which is similar to a window service.
For details have a look at
How to create a worker role
and also
Building Windows Azure Service: Worker Role Background Tasks Handler

Related

How to catch SQL Server trigger in C# code

I have to create an external service for existing database which is working with ERP system.
Edit: service will be running on the same machine where SQL Server is running.
Service has to listen for a trigger on a table with documents.
Scenario:
User creates a document
Trigger calls service method
Method queries the database to get data, create document and send it to external API.
Is it possible to catch trigger like that from a C# Worker Service?
It's technically possible to run arbitrary SQL CLR code in a trigger, and make remote web service or rpc calls to code running in a separate service. But since the trigger runs during the transaction and any code you run can delay or undo the database change, it's not recommended. And probably would not be supported by the ERP system.
So the best pattern here is to have the trigger write a row into a local table, and then have an external process poll that table and do the rest of the work, or to configure Change Data Capture or Change Tracking and have the external program query that.

SQL Azure export Data to FTP site

I have an Azure hosted (web-forms) asp.net website, using Azure SQL for the database.
I need to setup an automatic transfer of some of the data nightly to a specific FTP site. The data will be in CSV format... so just a basic query, CSV file created, and the file sent via FTP.
My first inclination would be to just create a specific web-page which does the query, creates the file, and sends it out (all in code) - and then schedule this using Azure Scheduler Jobs Collection.... but I'm just wondering if there would be another "best practice" method for doing this such as Azure Data Factory, connectors, etc?
Just wanted to get some input on what road to go down. Any help would be appreciated.
Thank you.
My first inclination would be to just create a specific web-page which does the query, creates the file, and sends it out (all in code) - and then schedule this using Azure Scheduler Jobs Collection.... but I'm just wondering if there would be another "best practice" method for doing this such as Azure Data Factory, connectors, etc?
Firstly, as you mentioned, you can run a job/task on schedule (Azure Scheduler, Azure WebJobs or Azure Functions can help you achieve it) to request that specific web-page to transfer data from Azure SQL database to FTP server.
Secondly, Azure Logic Apps enable us to use SQL Database connector and FTP connector to access/manage SQL Database and FTP server, you can try to use it. And this SO thread discussed transferring data from SQL database to FTP server using Azure Logic Apps, you can refer to it.

Sync data from salesforce to SQL database using a windows service at regular intervals

I have a requirement to create a Windows service which should get the updated data from Salesforce at regular intervals based on last updated date from a table. What is the best way to achieve this?
Currently, in our web application, we are using FuseIT connector to connect to Salesforce and get the updates. However, we need a Windows service which get the updated data from a sales contact table to get the updated data at regular intervals and sync it to custom SQL database on our side.
Here is a sample app that does something very similar to that: https://www.jamesward.com/2016/08/10/quick-easy-etl-from-salesforce-to-mysql-with-workflow-heroku/

Periodically invoking of c# application using job in SQL server

I want to invoke a c# application based on SQL server database. I have name's column in database. I want to check if there is any name present in the database then every after 1 hr my C# application should get invoked. I am asked to use a "job" concept in SQL server. Is it possible to perform this operation?
Job schedules are designed to do maintenance staffs. They actually do something periodicall, but the things they do is about backups, running T-SQL jobs, CleanUp and etc. I don't think doing this by an SQL job agent be a good solution.
If you want to check db in a constant interval, then you could simply write an intermediate app (windows service or a console App) and check your db changes every 1 hr. If your desired changes happened then invoke your C# application.
You could call a windows application using a shell. You could do it in an SQL server job or in a trigger.
Hope I helped!

Creating a Database Query Service

I've been asked to create a Service for our Parent Company. They don't care how I do it, as long as the data is sent to them.
We have an SQL 2000 Server that receives machine data via Data Transformation Services (DTS).
Our Parent Company wants me to create a Service that runs every 5 minutes or so to collect new data, summarize it, and forward it to them.
With my background in Windows Forms development, I naturally think that I should poll the database every 5-minutes using some type of Windows Service, then send that data over to our Parent Company.
The machine housing this data is an old Windows 2000 machine, and our Network Administrator has recommended that I write this as a Web Service on our newer Web Server.
I created a Web Service a few months back for the Web Server to pull work order information from our Parent Company, but I do not know how to make this Service execute a process every 5-minutes.
Yesterday, I learned how to create an Insert After Trigger when records were added to the table. Unfortunately, the triggers are not called because this old server uses DTS jobs. I was able to learn about Controlling Trigger Execution When Bulk Importing Data, but there does not seem to be a way to modify our old DTS jobs to enable the BULK INSERT command. It may not work on SQL Server 2000.
So, with this background, should I create a Windows Service or a Web Service?
How should I proceed?
I would not make a web service for a recurring task. Web services are not very comparable to a windows service.
btw: A simpler alternative might be to create a command-line app that runs, periodically via a scheduled task (read about the "AT scheduler in Server 2000"). I is just easier to install and make updates because it wouldn't require a reboot of your server each time you make an update.
If the webservice has a method which you can call that executes the data importing/converting exactly one time, you can use a windows task or cron job to make a request to that method. You can either add this task to the server that is hosting the service, or some other server as long as it can access the webservice.

Categories