Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 can we exicute exe file in procedure

Author  Topic 

boreddy
Posting Yak Master

172 Posts

Posted - 2009-04-24 : 04:09:33
Is it possible to execute .net exe file in the procedure ,
in the exe file contain some business logic i want to execute this throw the procedure is possible


Thanks in advance

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2009-04-24 : 04:17:02
ya.. using xp_cmdshell


Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled
Go to Top of Page

Rajesh Jonnalagadda
Starting Member

45 Posts

Posted - 2009-04-24 : 05:32:04
Hi,

Try this

CREATE PROCEDURE [dbo].[ExeProcedure]
AS
DECLARE
@Query nvarchar(255),
@Result nvarchar(255)
BEGIN

SET NOCOUNT ON;
SET @Query = '"D:\ExeName.exe"'
SET @Result = NULL
EXEC @Result = master.dbo.xp_cmdshell @Query
END
GO

Rajesh Jonnalagadda
[url="http://www.ggktech.com
"]GGK TECH[/url]
Go to Top of Page
   

- Advertisement -