Managed Code / Shell

W

Will Asrari

am working on a project now for a client that requires all managed code.
I have rewritten about 60% of the code and functionality in C# and have
now come to the complicated part of picking apart the existing stored
procedure and "managing" it. Two tasks that I am outing from the stored
procedure are as follows:

1) execution of a .vbs that creates a .txt file (CSV) of user
information
2) loading of said text file into an .exe and executing

I can achieve the same result as 1 with a streamwriter. This shouldn't
be too complicated. Number 2 is what I am worried about. The .exe will
reside on the same server where my application exists. What would be
the best way to accomplish this task in a managed way?

I tried opening the exe on the server by double-clicking it and got the
following error:

"%E: Cannot find "\Ent=' parameter on the command line."

So there is no GUI. It seems as if this is a simple console application.

Here is the line from the old stored procedure:

SET @LaunchImportString = '\\' + @AppServer +
'\applicationName\sys_exe\ga_imp2.exe /GO /Ent=' + cast(@EntID as
varchar(20)) + ' /Store=1'
exec master..xp_cmdshell @LaunchImportString, no_output


Thanks in advance,

- Will
 
A

Andrew Robinson

Will,

Funny finding you here.... One thing that you might look at is using SQL
CLR. It is definately "managed" and might allow you to write out your text
file from within SQL. Another option would be to call the new Windows
command shell aka Monad. Not sure on that and it is still in beta but it
might provide a managed environment I think?

Jennifer is still feeling pretty good so we might just join you for the BBQ.
What can we bring?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top