|
u$ SQL's BCP utility and/or Integration Services for SQL may be worth a gander.
|
|
|
|
|
You say potata...[^]
My take on these sorts of issues is use whatever you are comfortable with.
The advantage of the script is that it won't need recompiling if you need to make a change the logic is easily viewed by opening the script in notepad.
The advantage of the compiled code app is that the debug facilities in the IDE may be better.
You say potata..
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
I'd say write a script. It is what the scripting languages are there for. Size of your script (depending on the scripting language) will be much smaller (thus less effort) than the app. It should be much quicker to execute too (depending on the scripting language and your scripting skills). In the long run you can build yourself a scripting tool kit. Advantages of writing a script for the current project will possibly not show yet but will definitely show in the projects to come.
When you require the use of a scripting language in the future, you'll have scripts performing script related tasks and apps performing app related tasks and not a unmanageable toolkit consisting of both scripts and apps performing only script related tasks.
I agree with GuyThiebaut that you won't have advantages of debugging... thus would suggest sanity checks throughout your script (a good practice even if you're writing a compiled app).
"Program testing can be used to show the presence of bugs, but never to show their absence."
<< please vote!! >>
modified 11-Feb-14 8:56am.
|
|
|
|
|
R. Erasmus wrote: I agree with GuyThiebaut that you won't have advantages of debugging... thus would suggest sanity checks throughout your script (a good practice even if you're writing a compiled app).
Not ok... even scripts should get a complete test set. Especially as it is going to be important in production. Don't cut corners there, you'll regret it.
Cigarettes are a lot like hamsters. Perfectly harmless, until you put it in your mouth and light it on fire.
|
|
|
|
|
Agreed, if its going to be production code then it needs to be unit tested which makes the decision for you.
Scripts are good for adhoc operations tasks but not for a production system that's going to evolve and go through a number of versions
|
|
|
|
|
Have you thought of doing a best of both?
Personally I'd have an app that can read the input file and then use scripted functions for the reformatting.
speramus in juniperus
|
|
|
|
|
When I process CSV files this way I usually just do it all in SQL with temp tables. If you have to do a lot of string manipulation then procedural code might be better, but otherwise processing the CSV with a stored procedure is generally going to be fast and easy to maintain.
Otherwise I don't see much difference between a script and a compiled app, other than possibly speed. But if you can do it in set operations with SQL rather than with loops, that's going to be a huge speed gain right there.
|
|
|
|
|
For me, everything rounds to what would be easier, if the script language (or environment) have everything I need then I do a script, if the compiled app would be easier to create, then I go for the compiled app.
As a rule of thumb, if the script will end up with more than a hundred of lines, then a compiled app may be better.
|
|
|
|
|
Try this package, CsvHelper [^]
For my team this made handling csv files a snap in C#.
|
|
|
|
|
Try Power Shell script if like
|
|
|
|
|
I have several apps that do this and I have used scripts, console apps and now I pretty much create services.
1. Unless you control the box the script is on, some one is going to open up the script in a text editor just to look at it. Come you know you have. Ever think you can make it better with just a little tweak?
2. If people log into the box with different credentials and run your console app. Oops different results - must be a bug, not a security feature.
3. With a service I can control the user the app is executing under, and people are less likely to mess with it.
|
|
|
|
|
The issues that you expressed shouldn't have any thing to do with "script" or not unless the scripting language you have is severely limited in some way. It should still be able to log, recover from errors, etc.
|
|
|
|
|
I would prefer to do it in a compiled .NET application because I'm more familiar with C# than scripting languages and, as you pointed out in a later post, memory management is (IMHO) better in .NET.
However, whatever you choose to do, MAKE SURE THAT YOU WRITE TESTS FOR IT so that eight months down the line you can catch any bugs that the "tiny little small change" that you need to do might introduce.
|
|
|
|
|
Hi I've been searching awhile but haven't found what I was looking for. I am trying to upload a file to SQL database using HTML5 . I have the html5 side done but am looking for a resource or example of server side code that will upload the file to a SQL server. I know I'll using httpwebrequest. Do I use a webservice (asmx file)? a handler (axhx file)? or something else?
Thank you!
John
|
|
|
|
|
|
Thanks Richard, I'll give it a try, though I'm not using an aspx page.
|
|
|
|
|
Well, you mentioned .ashx and .asmx files, so you're presumably using ASP.NET, even if you're not using a WebForms page.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Member 10579202 wrote: or something else? Yes, go to proper place[^]
thatrajaCode converters | Education Needed
No thanks, I am all stocked up. - Luc Pattyn
When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is - Henry Minute
|
|
|
|
|
|
Well, here in the Land of Smiles, StarBucks put its mighty foot down on two brothers who operate a coffee street-cart in Bangkok who dared to use the name "StarBung" [^], with a logo that looks derivative, but which they claim reflects their Muslim heritage, and the fact their cart/stall is halal. fyi: one of the brothers goes by the nickname, "Bung."
The tempest-in-a-javapot is all over now; the brothers at first reportedly told StarBucks to shove off, and that they should pay them 3 million Baht (about $93K US) ... points for chutzpah !
But, this show of bravura didn't last long, and they folded; probably after they had an offer they couldn't refuse and still keep their heads on their shoulders from some local official.
fyi: StarBucks franchise coffee in Thailand could be used to tan leather, mummify road-kill, sterilize medical equipment, and open clogged drains; beyond that, I am not sure what it's good for.
“But I don't want to go among mad people,” Alice remarked.
“Oh, you can't help that,” said the Cat: “we're all mad here. I'm mad. You're mad.”
“How do you know I'm mad?” said Alice.
“You must be," said the Cat, or you wouldn't have come here.” Lewis Carroll
|
|
|
|
|
BillWoodruff wrote: fyi: StarBucks franchise coffee in Thailand could be used to tan leather, mummify road-kill, sterilize medical equipment, and open clogged drains; beyond that, I am not sure what it's good for. ftfy
Cheers,
Peter
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
Well, that's dumb.
It was broke, so I fixed it.
|
|
|
|
|
A man in a Ford Pinto pulls up next to a guy in a Rolls Royce at a stop sign. Their windows are open and he yells at the guy in the Rolls: "Hey, you got a telephone in there?" The guy in the Rolls says, "Yes, of course I do." "I got one too... see?" "Uh, huh, yes, that's very nice."
Then the man in the Pinto says, "You got a fax machine?" "Why, actually, yes, I do." "I do too! See? It's right here!" "Uh-huh." The light is just about to turn green and the guy in the Pinto says, "So, do YOU have a double bed in back there?" And the guy in the Rolls says, "NO! Do you?" "Yep, got my double bed right in back here. See?" The light turns green and the man in the Pinto takes off.
Well, the guy in the Rolls is not about to be one-upped, so he immediately goes to a custom shop and orders them to put a double bed in back of his car. About two weeks later, the job is finally done and he picks up his car and drives all over town looking for the Pinto. He finally finds it parked alongside the road so he pulls his Rolls up next to it. The windows on the Pinto are all fogged up and he feels a little awkward about it, but he gets out of his newly modified Rolls and taps on the foggy window of the Pinto. The man in the Pinto finally opens the window a crack and peeks out.
The guy in the Rolls says, "Hey, remember me?" "Yeah, yeah, I remember you. What's up?" "Check this out - I got a double bed installed in my Rolls!" And the man in the Pinto says, "You got me out of the shower to tell me that?!!"
/ravi
|
|
|
|
|
First time for me... LOLing!
5ed!
|
|
|
|
|
Very funny! Thanks Ravi needed a laugh.
BTW I used to own a Pinto years ago.
|
|
|
|