Avatar of phman1275
phman1275

asked on 

Export data to TXT file

Hi! I need to write a console app program or stored procedure to grab the office hours from the database table and export to TXT file. I am not so sure which one is the best, C# or stored procedure.

Here are the requirements:

1. Right now the database table has  Mon - Sun office hour columns.
   
   Ex. MondayOpening, MondayClosing, TuesdayOpening, TuesClosing..........Sunday

2. Will add 5 new fields to the TXT file
   
    Ex. Operation1, Operation2, Operation3, Operation4, Operation5 (All are varchar data type)

Output:
 
   The output should like this:

    Ex. If Mon, Tue, Wed office hours are the same then put "Monday - Wednesday: 8:00 am to 8:00 pm
          to Operation1.

          if Mon, Wed, Fri are the same then put "Monday, Wednesday, Friday:...." t Operation 1.....etc

Do you have any suggestion?
DatabasesC#

Avatar of undefined
Last Comment
gr8gonzo
Avatar of gr8gonzo
gr8gonzo
Flag of United States of America image

Sounds like a good use of a simple C# application. Do you have a specific question?
Avatar of ste5an
ste5an
Flag of Germany image

What database product?

Many of those have bulk export tools ready to use.

I am not so sure which one is the best, C# or stored procedure.
Both, somehow.

Cause you should always have a stored procedure, which does the data retrieval.
Then, whatever export tool you use C#, PowerShell, bcp (SQL Server), you call this stored procedure.
Avatar of gr8gonzo
gr8gonzo
Flag of United States of America image

Your question was:
"I am not so sure which one is the best, C# or stored procedure."

That is not necessarily an "or" situation. The stored procedure could set up and format the data, but it still needs to be executed. That is where C# or some other database client would exist - that client would need to execute the stored procedure and then write the output to the file.

If you need more specific help, then you need to provide us with some details. ste5an asked you which database you were using and you did not respond to him but instead tried to close the question. Nobody can help you if you don't give enough information - any examples would be different based on which database you're using.
Avatar of gr8gonzo
gr8gonzo
Flag of United States of America image

Objecting - we can help, but you need to answer the questions.
Avatar of phman1275
phman1275

ASKER

close
ASKER CERTIFIED SOLUTION
Avatar of gr8gonzo
gr8gonzo
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of gr8gonzo
gr8gonzo
Flag of United States of America image

-sigh- in the future, you'll get more help if you communicate with the people you're asking for help. We are not mind readers.
C#
C#

C# is an object-oriented programming language created in conjunction with Microsoft’s .NET framework. Compilation is usually done into the Microsoft Intermediate Language (MSIL), which is then JIT-compiled to native code (and cached) during execution in the Common Language Runtime (CLR).

98K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo