Home All Groups Group Topic Archive Search About


Author
9 Mar 2005 2:37 AM
Benny
Is there a way I can call VB.net code from a stored procedure? I need to
schedule a sql job (stored procedure) and in the logic of the stored
procedure, I need to call vb.net code to generate a pdf document.

Your support will very much helpful Thanks in advance.

Regards,
Benny

Author
9 Mar 2005 2:57 AM
Jason Brown [MSFT]
Yes, there's an extended stored proc called (IIRC) xp_cmdshell which can
call external code, though there are ome caveats on its use which you should
be able to find in the SQL documentation

there's also a way of instantiating COM objects from SQL with another XSP,
the name of which has totally escaped me - I'll look it up shortly.


--
Jason Brown
Microsoft GTSC, IIS

This posting is provided "AS IS" with no warranties, and confers no rights.

Show quote
"Benny" <agbe***@lycos.com> wrote in message
news:%231YMDEFJFHA.2700@TK2MSFTNGP09.phx.gbl...
> Is there a way I can call VB.net code from a stored procedure? I need to
> schedule a sql job (stored procedure) and in the logic of the stored
> procedure, I need to call vb.net code to generate a pdf document.
>
> Your support will very much helpful Thanks in advance.
>
> Regards,
> Benny
>
>
Author
9 Mar 2005 4:39 AM
Aaron [SQL Server MVP]
sp_OACreate, etc.  I give examples of using them to create a CDO.Message
object in http://www.aspfaq.com/2403

Not exactly the best use of resources, FWIW.  Some insiders (e.g. Euan) have
alluded to some serious memory issues with some of these tools.  Besides,
sp_OA* are for instantiating regular old COM objects, not .NET.  I think the
OP will have to go the route of xp_cmdshell and all the security
implications that come with it.


On 3/8/05 9:57 PM, in article uk37JPFJFHA.2***@TK2MSFTNGP14.phx.gbl, "Jason
Brown [MSFT]" <i-brj***@online.microsoft.com> wrote:

Show quote
> Yes, there's an extended stored proc called (IIRC) xp_cmdshell which can
> call external code, though there are ome caveats on its use which you should
> be able to find in the SQL documentation
>
> there's also a way of instantiating COM objects from SQL with another XSP,
> the name of which has totally escaped me - I'll look it up shortly.
>
Author
9 Mar 2005 4:42 AM
Jason Brown [MSFT]
Thanks Aaron


--
Jason Brown
Microsoft GTSC, IIS

This posting is provided "AS IS" with no warranties, and confers no rights.

Show quote
"Aaron [SQL Server MVP]" <ten.xoc@dnartreb.noraa> wrote in message
news:BE53E833.250E%ten.xoc@dnartreb.noraa...
> sp_OACreate, etc.  I give examples of using them to create a CDO.Message
> object in http://www.aspfaq.com/2403
>
> Not exactly the best use of resources, FWIW.  Some insiders (e.g. Euan)
> have
> alluded to some serious memory issues with some of these tools.  Besides,
> sp_OA* are for instantiating regular old COM objects, not .NET.  I think
> the
> OP will have to go the route of xp_cmdshell and all the security
> implications that come with it.
>
>
> On 3/8/05 9:57 PM, in article uk37JPFJFHA.2***@TK2MSFTNGP14.phx.gbl,
> "Jason
> Brown [MSFT]" <i-brj***@online.microsoft.com> wrote:
>
>> Yes, there's an extended stored proc called (IIRC) xp_cmdshell which can
>> call external code, though there are ome caveats on its use which you
>> should
>> be able to find in the SQL documentation
>>
>> there's also a way of instantiating COM objects from SQL with another
>> XSP,
>> the name of which has totally escaped me - I'll look it up shortly.
>>
>
Author
9 Mar 2005 4:50 AM
Benny
Thanks to you Jason and Aaron, Will try and get back.

Kind REgards,
Benny
Show quote
"Jason Brown [MSFT]" <i-brj***@online.microsoft.com> wrote in message
news:eAaQ1JGJFHA.2524@TK2MSFTNGP10.phx.gbl...
> Thanks Aaron
>
>
> --
> Jason Brown
> Microsoft GTSC, IIS
>
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
> "Aaron [SQL Server MVP]" <ten.xoc@dnartreb.noraa> wrote in message
> news:BE53E833.250E%ten.xoc@dnartreb.noraa...
>> sp_OACreate, etc.  I give examples of using them to create a CDO.Message
>> object in http://www.aspfaq.com/2403
>>
>> Not exactly the best use of resources, FWIW.  Some insiders (e.g. Euan)
>> have
>> alluded to some serious memory issues with some of these tools.  Besides,
>> sp_OA* are for instantiating regular old COM objects, not .NET.  I think
>> the
>> OP will have to go the route of xp_cmdshell and all the security
>> implications that come with it.
>>
>>
>> On 3/8/05 9:57 PM, in article uk37JPFJFHA.2***@TK2MSFTNGP14.phx.gbl,
>> "Jason
>> Brown [MSFT]" <i-brj***@online.microsoft.com> wrote:
>>
>>> Yes, there's an extended stored proc called (IIRC) xp_cmdshell which can
>>> call external code, though there are ome caveats on its use which you
>>> should
>>> be able to find in the SQL documentation
>>>
>>> there's also a way of instantiating COM objects from SQL with another
>>> XSP,
>>> the name of which has totally escaped me - I'll look it up shortly.
>>>
>>
>
>
Author
9 Mar 2005 4:54 AM
Aaron [SQL Server MVP]
> Is there a way I can call VB.net code from a stored procedure? I need to
> schedule a sql job (stored procedure) and in the logic of the stored
> procedure, I need to call vb.net code to generate a pdf document.

Have you considered going the other way?  Have the stored procedure log an
entry into a queue table.  Have a windows scheduled task wake up every
minute, fire up a VB.Net app, it checks the database and if there's anything
in the queue, it creates the PDF document(s).

A

AddThis Social Bookmark Button