Showing posts with label snippet. Show all posts
Showing posts with label snippet. Show all posts

Wednesday, March 21, 2012

ExecuteWithResultsAndMessages2, syntax problem?

Here is a code snippet that I am using from Ken's sp_run_xml_proc.
I want to modify it, such that when I invoke sp_run_xml_proc I want to pass
a SP and a parameter. Something like EXEC sp_run_xml_proc 'get_xml_LAC',
@.parameter. This @.parameter should be used as a parameter to get_xml_LAC
stored proc. Is it possible with 'ExecuteWithResultsAndMessages2'? If yes,
then can you direct me how I can fix it? BOL hasn't been much help.
EXEC @.hr = sp_OAMethod @.object, 'ExecuteWithResultsAndMessages2',
@.results OUT, @.procname, @.msgs OUT, @.parameter
IF @.hr <> 0 BEGIN
EXEC sp_displayoaerrorinfo @.object, @.hr
RETURN
ENDHi
Have you tried adding the value to the procedure name?
set @.procname = @.procname + ' ' + @.parameter
John
"S" wrote:

> Here is a code snippet that I am using from Ken's sp_run_xml_proc.
> I want to modify it, such that when I invoke sp_run_xml_proc I want to pas
s
> a SP and a parameter. Something like EXEC sp_run_xml_proc 'get_xml_LAC',
> @.parameter. This @.parameter should be used as a parameter to get_xml_LAC
> stored proc. Is it possible with 'ExecuteWithResultsAndMessages2'? If yes,
> then can you direct me how I can fix it? BOL hasn't been much help.
> EXEC @.hr = sp_OAMethod @.object, 'ExecuteWithResultsAndMessages2',
> @.results OUT, @.procname, @.msgs OUT, @.parameter
> IF @.hr <> 0 BEGIN
> EXEC sp_displayoaerrorinfo @.object, @.hr
> RETURN
> END|||Worked like a charm. Appreciate it.
"John Bell" wrote:
> Hi
> Have you tried adding the value to the procedure name?
> set @.procname = @.procname + ' ' + @.parameter
> John
> "S" wrote:
>

Monday, March 12, 2012

Execute SSIS project from ASP.NET page

Can you execute a SSIS project from an ASPX page? Or do you have to wrap it into a SQL job and run that?

Does anybody have a code snippet to do this?

Well, you can, but it is rarely a good idea for at least two reasons:

you are sharing address space and threads with IIS, so the scalability of this solution is limited

execute SSIS packge using VB(6.0)

Any one has code snippet for executing SSIS packge using VB(6.0)

Once you have created the COM Callable Wrapper (CCW) for the managed SSIS runtime (ManagedDTS assembly), the code will look almost identical to previous VB6 code for calling a DTS package -- after instantiating a Package object, not much more than LoadFrom and Execute.

However I do not have a sample to provide. But the VB.NET sample should be helpful. http://msdn2.microsoft.com/en-us/library/ms136090.aspx

-Doug

|||

Thank you Douglas.Now i can think of CCW first.By the way do you know any of the tools for creating CCW for ManagedDTs.dll.

I do not have .net framework installed on my system.so is that possible to create CCW without .net framework on my machine?

thanks in advance

|||

I doubt it. You need the tlbexp.exe utility from the Framework SDK. But I haven't used that tool in a long time. (Visual

Studio performs this step for you invisibly.) Please look for "COM Callable Wrapper" in the MSDN Library for more information.

-Doug