Hello,
Is it possiable to call a exe file from a sql stored procedure, and what
do i need to look into to do this.
also
Is it possiable to read a text file from a sql stored statement?Tdar,
You can use xp_cmdshell. Do not use this with a graphical application that
required end-user interaction
For the latter, try:
CREATE TABLE #T (TEXT VARCHAR(500))
INSERT INTO #T EXEC MASTER..XP_CMDSHELL 'TYPE C:\TEXTFILE.TXT'
SELECT * FROM #T
--DROP TABLE #T
HTH
Jerry
"Tdar" <Tdar@.noemail.nospam> wrote in message
news:e1bd0UEyFHA.2228@.TK2MSFTNGP11.phx.gbl...
> Hello,
> Is it possiable to call a exe file from a sql stored procedure, and
> what do i need to look into to do this.
> also
> Is it possiable to read a text file from a sql stored statement?
>
>
>|||Look into xp_cmdShell for calling exe's
For reading files use BCP or DTS
http://sqlservercode.blogspot.com/
"Tdar" wrote:
> Hello,
> Is it possiable to call a exe file from a sql stored procedure, and wh
at
> do i need to look into to do this.
> also
> Is it possiable to read a text file from a sql stored statement?
>
>
>|||1: Read in Books Online about xp_cmdshell. Need to be a console application,
not a Windowing app.
2. Sure. What do you want to do with the data that you read from the text fi
le? Import to a table?
Use BULK INSERT.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Tdar" <Tdar@.noemail.nospam> wrote in message news:e1bd0UEyFHA.2228@.TK2MSFTNGP11.phx.gbl...
> Hello,
> Is it possiable to call a exe file from a sql stored procedure, and wha
t do i need to look into
> to do this.
> also
> Is it possiable to read a text file from a sql stored statement?
>
>
>|||The data will just be on the second line of the text file and semicolon
delimited, that data
Will just be recorded into a table. The Program is an old Dos app so I guess
that is as good as console
As you can get.
Thanks everyone this should help a lot.
David
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:uHJlOhEyFHA.2212@.TK2MSFTNGP15.phx.gbl...
> 1: Read in Books Online about xp_cmdshell. Need to be a console
> application, not a Windowing app.
> 2. Sure. What do you want to do with the data that you read from the text
> file? Import to a table? Use BULK INSERT.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Tdar" <Tdar@.noemail.nospam> wrote in message
> news:e1bd0UEyFHA.2228@.TK2MSFTNGP11.phx.gbl...
>|||If you want to read into a table, check out BULK INSERT, BCP and DTS.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Tdar" <Tdar@.noemail.nospam> wrote in message news:OMEuCGFyFHA.2960@.tk2msftngp13.phx.gbl...
> The data will just be on the second line of the text file and semicolon
> delimited, that data
> Will just be recorded into a table. The Program is an old Dos app so I gue
ss
> that is as good as console
> As you can get.
>
> Thanks everyone this should help a lot.
>
> David
>
>
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote i
n
> message news:uHJlOhEyFHA.2212@.TK2MSFTNGP15.phx.gbl...
>
Sunday, March 11, 2012
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment