Click here to Skip to main content
15,881,424 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have and sql trigger insert statement on stock master.
I have inserted the trigger data into stockmasterhistory table to track the inserted stocks.

No i want stockmasterhistory table to extract into an excel file every 5 minute. In order to do this i must create an exe on sql to export the stockmasterhistory data into an excel file.

Please help

What I have tried:

Hi,

I have and sql trigger insert statement on stock master.
I have inserted the trigger data into stockmasterhistory table to track the inserted stocks.

No i want stockmasterhistory table to extract into an excel file every 5 minute. In order to do this i must create an exe on sql to export the stockmasterhistory data into an excel file.

Please help
Posted
Updated 27-Jul-20 23:47pm
Comments
OriginalGriff 28-Jul-20 5:31am    
And?
What have you tried?
Where are you stuck?
What help do you need?

There are lots of choices/opportunities depending on requirements you haven't stated (reliability, robustness etc) - two might be

1) Write a C# 'console' mode program that fires off a timer every 5 minutes to check your database and extract the relevant records to a file, use 'NSSM' to install as an auto-start service and start the service

2) Write C# Console program, use TopShelf to make a service and Quartz cron job for the work task ...
 
Share this answer
 
Here is an example that uses SSIS: Export output of SQL Server script to Excel (SSIS)[^]

Then you could create an SQL Server job to run it on a regular basis, see information here: Create a Job for exporting a SQL Server view into Excel on a daily basis - Stack Overflow[^]

Beware that this functionality is not available in SQL Server Express!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900