Flags needs to set to run stored procedure fast

Hi,
I need to understand what all flags that we need to set run stored procedure fast.
e.g. set no count on command is one option, please redirect me to other command so that I can use those for each stored procedure.

That is the only general option, however, no relationship to performance.  Other options may be appropriate depending on the program statements.
To achieve good performance, optimize the stored procedure:
http://www.sqlusa.com/articles/query-optimization/
The underlying principles of stored procedure optimization:
1. Each statement must be optimized
2. Avoid unnecessary statements & excessive looping
Kalman Toth Database & OLAP Architect
SQL Server 2014 Database Design
New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014

Similar Messages

  • How run stored procedure in Crystal report?

    I have table from query in report, but first I need to run stored procedure in report.
    How I need to do it?

    previous post not correct
      this is correct
    When I need to run my report
    1) I need to run storeed procedure ( the stored procedure will update some tables)
    I just used Add Command and added stored procedure in Database Fields, but I think the procedure doesn't work in report. Maybe I need add new commant and write there:
    exec ProcedureName par1 par2
    or
    exec ProcedureName (par1={?parameter1} par2={?parameter2})
    It's doesn't work. What I need to do?
    2) I use some query in report
    ex.
    select t1.col1, t2.col2, t6.col3 t1.col7 t4.col1
    from t1, t2, t6, t4, r4, ju, hh
    where hh.col11={?parameter1}
    and ju.col3=6
    and r4.col3={?parameter2}
    group by .....
    order by ......
    How I need to create me report? What I need to do first?
    If parameter in stored procedure par1={?parameter1} in query
    and par2={?parameter2}

  • Is it possible to trigger an error so that the running stored procedure is stopped?

    Hello all,
    I want to run an existing stored procedure and then I want to manually trigger an error/abort/interruption so see what happens and do some testing with that.
    Is it possible to manually trigger an error/abort/interruption on a running stored procedure so that it is stopped?
    If yes, how can I do that?
    I hope someone has an idea. For me it sounds not really difficult, but I just do not get the idea how to do it.
    Kind regards
    Peter

    Hello Visakh,
    I dont want to modify the existing procedure. I just want to run it and than stop it, but not with the button to stop it, but "kill" it somehow with an error (with not destroying the database).
    Nope you cant simulate an intermediate failure inside procedure code from outside. For that you have to modify the actual sp code itself
    Another way is by doing data manipulation in such a way which causes a error in procedure but for that you need to revisit the logic to ensure you do changes in such way as to cause an error
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Can't Run Stored Procedure in Package

    Hi,
    I am trying to run a stored procedure that has multiple in and out paramaters. The procedure can only be viewed in my Connections panel by navigating Oher Users | <user> | Packages | <package> | <procedure>
    If I right click <procedure>, the menu items are "Order Members By..." and "Create Unit Test" (greyed out). The ability to "Run" the procedure does not seem possible when it's accessed by user.
    I have been trying to find an example of how to create an anonymous block so that I can run the procedure as a SQL file, but haven't found anything that works.
    Does anyone know how I can execute this procedure from SQL Developer? I am using Version 2.1.1.64.
    Thanks in advance!

    Thanks for replying. I did understand the basics of an anonymous block, but what I didn't understand was how to set the out parameters. I should have been more detailed in my question. However, I did get the answer here:
    http://stackoverflow.com/questions/3991721/run-stored-procedure-in-sql-developer
    Thanks again for replying. I appreciate you taking the time.

  • Running stored procedures from HTML DB

    Hello.
    Is it possible to run stored procedures/functions from HTML DB? If yes, how to do it?
    Davide

    If the variable v_return_amount is a number, how can you assign a boolean to it? Are you sure your function is valid? I would write it slightly different:
    CREATE OR REPLACE FUNCTION verify_amount (
    v_invoices_pk IN NUMBER,
    v_new_amount IN NUMBER
    RETURN BOOLEAN
    IS
    CURSOR c_amount
    IS
    SELECT amount
    FROM invoices
    WHERE invoices.invoices_pk = v_invoices_pk;
    CURSOR c_dist_amount
    IS
    SELECT SUM (cost_distribution.amount)
    FROM cost_distribution
    WHERE cost_distribution.invoices_pk = v_invoices_pk;
    v_sum_amount NUMBER;
    v_invoices_amount NUMBER;
    BEGIN
    OPEN c_dist_amount;
    FETCH c_dist_amount
    INTO v_sum_amount;
    CLOSE c_dist_amount;
    OPEN c_amount;
    FETCH c_amount
    INTO v_invoices_amount;
    CLOSE c_amount;
    IF (v_invoices_amount <= v_sum_amount + v_new_amount)
    THEN
    RETURN TRUE;
    ELSE
    RETURN FALSE;
    END IF;
    RETURN v_return_amount;
    EXCEPTION
    WHEN OTHERS
    THEN
    RETURN FALSE;
    END;
    Other than that, I am not sure about your cursors but I can't judge from here. The other thing is how you use the function in the validation process. Can you try to correct and tell if it worked out?
    Denes Kubicek

  • Need to call funtion in stored procedure to run one customized report

    Hi,
    I need to call one function in stored procedure for our customized report. Can anyone please help me in calling the function in stored procedure and provide the syntax for the same.
    Thanks,
    Kalpana.

    Either open an existing report. You'l see so many examples.
    or
    http://www.google.co.in/#hl=en&source=hp&biw=1024&bih=586&q=call+function+in+stored+procedure+sql&aq=1&aqi=g2g-m2&aql=&oq=Call+function+in+stored&gs_rfai=&fp=dbefe777997d3915

  • How to run stored procedure in DOS command line????

    Hi,
    I want to run a stored procedure in DOS command line?
    (My_Stored_Procedure is the stored procedure that I want to run )
    This is what I did in DOS prompt
    C:\>sqlplus scott/tiger exec lMy_Stored_Procedure <Return>
    Obviously it is NOT working. Please send me the correct way to fix this.
    Thanks so much in advance for helping.
    Cuong

    Billy  Verreynne  wrote:
    BluShadow wrote:
    True Billy, but even Windows hasn't completely got away from using the "DOS" word...Yeah - the command line/shell environment is based on that of the old DOS command interpreter. But Microsoft does not make the mistake of call it DOS.
    In fact, with earlier versions of Windows NT, a 16bit DOS real-mode virtual machine was supported. This was very kewl.
    Running a large BBS with multiple nodes back then required a DOS machine per node, an IPX network, and a Novell file server.Novell Netwars. ;)
    Ahhhh! good old DOS... so many good programs written at that low level, outside the Windoze environment.Yeah.. cut my teeth on writing code for DOS. Still have all my old BIOS and assembler manuals for it. Wrote my own screen s/w (write to a buffer and then move it into the video buffer, instead of writing char wise to the video buffer via interrupts), mucking about with my own concurrent threading model (using very simplistic cooperative multitasking) and so on. Heck, wrote tons of s/w on DOS... :-)Yeah I've still got a copy of my old machine code programs for writing to buffers and screen memory switching for smooth animation. Run them nowadays and they run like sh!t off a shovel. And all my old coursework including writing an interpreted language and multi-window (dos based windows) editor, parser and the code to execute the language and display the output. Oooo, and so much other stuff.
    Awesome back then as you got really intimate with the o/s and hardware. This is sorely lacking today in environments like Java. And I think the reason why so much code written today is less than optimal - to put it kindly.Exactly. Started for me on the Sinclair zx81 (writing Basic), then the Sinclair Spectrum (Basic and Assembly), then Sinclair QL (yes I really had one!) and then the BBC Master 128K (where I got to writing my own rom filing system and creating my own eproms, to integrate with the word processor for additional printing features etc. as well as storing games on rom for speedy loading - and I still have it and it still works!)
    It's that level of working with the underlying memory and assembly language that gives you the understanding of how values are passed between code using the stack and registers, and how memory allocation and referencing is done etc. As you say... it's missed in a lot of todays teaching, which just seems too high level and misses the basic concepts of things such as datatypes and why they are different. I bet half the modern programmers wouldn't have a clue how to do multiplication or division of binary numbers using the carry flag.

  • Reg: Need help to call a Stored Procedure - Out Parameter using DBAdapter

    HI
    I have created a procedure with Out Parameter, using DBAdapater i have invoked it. I have assigned the out parameter also. But while running i am getting this error.
    My Procedure is shown below. It executes successfully when its run in database.
    create or replace
    PROCEDURE SP_QUERY(s_string in varchar2, retCodeString out varchar2)
    AS
    l_sql_stmt varchar2(1000);
    BEGIN
    l_sql_stmt := s_string;
    EXECute immediate l_sql_stmt;
    commit;
    if SQLCODE = 0 then
    retCodeString := 'OK';
    end if;
    END;
    java.lang.Exception: oracle.sysman.emSDK.webservices.wsdlapi.SoapTestException:
    Client received SOAP Fault from server : Exception occured when binding was invoked.
    Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'ExecuteScript' failed due to:
    Stored procedure invocation error. Error while trying to prepare and execute the SOADEMO.SP_QUERY API.
    An error occurred while preparing and executing the SOADEMO.SP_QUERY API.
    Cause: java.sql.SQLException: ORA-06550: line 1, column 15:
    PLS-00904: insufficient privilege to access object SOADEMO.SP_QUERY ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored Check to ensure that the API is defined in the database and that the parameters match the signature of the API.
    This exception is considered not retriable, likely due to a modelling mistake.
    To classify it as retriable instead add property nonRetriableErrorCodes with value "-6550" to your deployment descriptor (i.e. weblogic-ra.xml).
    To auto retry a retriable fault set these composite.xml properties for this invoke: jca.retry.interval, jca.retry.count, and jca.retry.backoff.
    All properties are integers. ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution.
    at oracle.sysman.emas.model.wsmgt.WSTestModel.invokeOperation(WSTestModel.java:808) at oracle.sysman.emas.view.wsmgt.WSView.invokeOperation(WSView.java:384)
    Please help me in this issue.

    Hi
    Right now i geeting the below error
    java.lang.Exception: oracle.sysman.emSDK.webservices.wsdlapi.SoapTestException: Client received SOAP Fault from server : oracle.fabric.common.FabricException:
    oracle.fabric.common.FabricInvocationException: java.lang.RuntimeException: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist :
    java.lang.RuntimeException: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist
    at oracle.sysman.emas.model.wsmgt.WSTestModel.invokeOperation(WSTestModel.java:808) at oracle.sysman.emas.view.wsmgt.WSView.invokeOperation(WSView.java:384)
    at oracle.sysman.emas.view.wsmgt.WSView.invokeOperation(WSView.java:301) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.
    invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.sun.el.parser.AstValue.invoke(Unknown Source)
    at com.sun.el.MethodExpressionImpl.invoke(Unknown Source) at org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.
    invoke(MethodExpressionMethodBinding.java:53) at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodBinding(UIXComponentBase.java:1256)
    at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:183) at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.
    run(ContextSwitchingComponent.java:92) at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361)
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96) at oracle.adf.view.rich.component.fragment.
    UIXInclude.broadcast(UIXInclude.java:102) at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:92)
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361) at oracle.adf.view.rich.component.
    fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96) at oracle.adf.view.rich.component.fragment.UIXInclude.
    broadcast(UIXInclude.java:96) at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475) at javax.faces.component.UIViewRoot.
    processApplication(UIViewRoot.java:756) at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeApplication(LifecycleImpl.java:889) at
    oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:379) at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.
    execute(LifecycleImpl.java:194) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265) at weblogic.servlet.internal.
    StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227) at weblogic.servlet.internal.StubSecurityHelper.
    invokeServlet(StubSecurityHelper.java:125) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.sysman.emSDK.license.LicenseFilter.doFilter(LicenseFilter.java:101) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:106) at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446) at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60) at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446) at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271) at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177) at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.help.web.rich.OHWFilter.doFilter(Unknown Source) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.sysman.emas.fwk.MASConnectionFilter.doFilter(MASConnectionFilter.java:41) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:179) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.sysman.eml.app.AuditServletFilter.doFilter(AuditServletFilter.java:179) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.sysman.eml.app.EMRepLoginFilter.doFilter(EMRepLoginFilter.java:203) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.sysman.core.model.targetauth.EMLangPrefFilter.doFilter(EMLangPrefFilter.java:158) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.sysman.core.app.perf.PerfFilter.doFilter(PerfFilter.java:141) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.sysman.eml.app.ContextInitFilter.doFilter(ContextInitFilter.java:542) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119) at java.security.AccessController.doPrivileged(Native Method) at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315) at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442) at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103) at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171) at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120) at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277) at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209) at weblogic.work.ExecuteThread.run(ExecuteThread.java:178) Caused by: oracle.sysman.emSDK.webservices.wsdlapi.SoapTestException: Client received SOAP Fault from server : oracle.fabric.common.FabricException: oracle.fabric.common.FabricInvocationException: java.lang.RuntimeException: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist : java.lang.RuntimeException: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist at oracle.sysman.emSDK.webservices.wsdlapi.dispatch.DispatchUtil.invoke(DispatchUtil.java:362) at oracle.sysman.emSDK.webservices.wsdlparser.OperationInfoImpl.invokeWithDispatch(OperationInfoImpl.java:1004) at oracle.sysman.emas.model.wsmgt.PortName.invokeOperation(PortName.java:750) at oracle.sysman.emas.model.wsmgt.WSTestModel.invokeOperation(WSTestModel.java:802) ... 79 more Caused by: oracle.j2ee.ws.client.jaxws.JRFSOAPFaultException: Client received SOAP Fault from server : oracle.fabric.common.FabricException: oracle.fabric.common.FabricInvocationException: java.lang.RuntimeException: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist : java.lang.RuntimeException: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist at oracle.j2ee.ws.client.jaxws.DispatchImpl.throwJAXWSSoapFaultException(DispatchImpl.java:1040) at oracle.j2ee.ws.client.jaxws.DispatchImpl.invoke(DispatchImpl.java:826) at oracle.j2ee.ws.client.jaxws.OracleDispatchImpl.synchronousInvocationWithRetry(OracleDispatchImpl.java:235) at oracle.j2ee.ws.client.jaxws.OracleDispatchImpl.invoke(OracleDispatchImpl.java:106) at oracle.sysman.emSDK.webservices.wsdlapi.dispatch.DispatchUtil.invoke(DispatchUtil.java:358) ... 82 more

  • Parameter in Query manager running stored procedure

    Hi Experts!
    I have a stored procedure, which is waiting a parameter.
    I would like to write a query in sap with parameter using sap language:
    exec sp_leltar [%0]
    The parameter is numeric, but when running the query above, it is giving an error:"Userdefined errors".
    Any idea?Thats not a way to write the parameter value on editor field.

    I have tried to run the following:
    select from dbo.omaleltfej t0/
    declare @leltid numeric OUTPUT
    /* where*/
    set @leltid = /* t0._leltfejid */ [%0]
    exec omaleltareredmeny2 @leltid
    Error message:"...Can not use the output option in declare or create function statement..."
    I gave up to solve it, because this is not an SAP table, it is not possibble to do.
    Thank you for your effort.

  • How to Run Stored Procedures from Teststand

    I am trying to get teststand to run an SQL stored procedure but I always get the following error
    Error executing substep 'Post'.
    The following SQL command failed: 'EXECUTE cdt_st_test...'
    Native error code -2147217900 0x80040e14
    Microsoft OLE DB Provider for SQL Server:
    Syntax error or access violation
    It is a test stored procedure that doesn't pass any parameters.
    Which steps must I use and how do I pass parameters.

    I have sussed it now. I was setting the "Command Type" to stored procedure instead of default. I changed it back and did "EXECUTE cdt_st_test" and it works. I have also added the parameters there as well.

  • Running Stored procedures from Forms

    I have several stored procedures (stored in the database) that I
    want to run from Forms (client), but when they're running my
    application (in Forms) is frozen until the procedure end.
    I don't know how to run that stored without lock the application,
    somebody Can Help me???
    THANKS
    null

    The second parameter of the DBMS_JOB.SUBMIT procedure needs to be
    a valid PL/SQL call, i.e. it must at least be terminated by a
    semicolon. You could also wrap it into an anonymous PL/SQL block,
    like: 'BEGIN SP_CREA_FACTURAS_PADRE; END;'
    Marisol (guest) wrote:
    : Dietmar:
    : I put this code in my application and I didn't get any response
    : DBMS_JOB.SUBMIT( iJobNumber,
    : 'SP_CREA_FACTURAS_PADRE',
    : SYSDATE,
    : 'null',
    : FALSE);
    : COMMIT;
    : When I select the option that executes this code my application
    : ends without any message...
    : You know why is this happen?
    : How can I resolve??
    : Thanks :)
    null

  • How to Store the result sets of a stored procedure that is returning more that one result set in two different table ?

    Hi Experts,
       I have on stored procedure which returns mote than one resultset i want that to store in two different temp table how can achieve this in SQL server.
     following is the stored procedure and table that i need to create.
    create procedure GetData as begin select * from Empselect * from Deptend 
    create table #tmp1 (Ddeptid int, deptname varchar(500),Location varchar(100))
    Insert into #tmp1 (Ddeptid , deptname ,Location )
    exec GetData
    create table #tmp (empid int , ename varchar(500),DeptId int , salary int)
    Insert into #tmp (empId,ename,deptId,salary)
    exec GetData
    Niraj Sevalkar

    You cant get two resultsets out of SP like this. The workaround is to merge and bring the resultsets.
    For this number of columns as well as corresponding datatypes have to be compatible. Also you will need one additional column which indicates resultset value. Then use this as filter to get your desired resultset out
    create procedure GetData as
    begin
    select 'resultset1' as Cat,*,.. N columns from Emp
    union all
    select 'resultset2' as Cat,*,.. N columns from Dept
    end
    create table #tmp1 (Ddeptid int, deptname varchar(500),Location varchar(100))
    Insert into #tmp1 (Ddeptid , deptname ,Location )
    Select column1,column2,column3
    from OPENROWSET('SQLOLEDB','Data Source=Server_name;Trusted_Connection=yes;
    Integrated Security=SSPI','Execute yourdb..GetData')
    WHERE Cat = 'resultset1'
    create table #tmp (empid int , ename varchar(500),DeptId int , salary int)
    Insert into #tmp (empId,ename,deptId,salary)
    Select column1,column2,column3, column4
    from OPENROWSET('SQLOLEDB','Data Source=Server_name;Trusted_Connection=yes;
    Integrated Security=SSPI','Execute yourdb..GetData')
    WHERE Cat = 'resultset2'
    also see
    http://sqlblogcasts.com/blogs/madhivanan/archive/2007/11/26/select-columns-from-exec-procedure-name-is-this-possible.aspx
    Another method is to populate table with relevant resultset within procedure itself and then select from the table directly outside.
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Error message for running stored procedure

    Hello expert,
    I got error message for a stored procedure running as follows, will you please tell me what that error is? what is the reason for that error? appreciate very much.
    Job name=PROD DWH REPORT MART LOAD.1
    Job owner=DEVTEAM
    Job type=SQL Script
    Job status=Error
    Occurred At=Aug 9, 2011 5:26:29 AM EDT
    Target Name=proddw(Database Instance)
    Job output=
    Command:Output Log
    SQL*Plus: Release 10.2.0.3.0 - Production on Tue Aug 9 03:00:07 2011
    Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
    SQL> SQL> SQL> SQL> Connected.
    SQL> SQL> SQL> SQL> SQL> SQL>
    TO_CHAR(SYSDATE,'DD-
    09-aug-2011 03:00:07
    SQL> SQL>
    Many Thanks,

    What error? I can't see an error.

  • How to run stored procedure IC Data / to define according script logic file

    We want to execute the stored procedure IC Data before the IC Booking. Could anybody tell me, how we have to define the script logic file in detail?
    We try it with this code (that runs without any error, but 0 rows are calculated, 0 rows are updated)
    *Run_stored_procedure=spicdata('%App%','%C_Category_Set%','%time_set%','','%entity_set%','','','Input','I','%logtable%','%scopetable%')
    *commit
    We also had tried with this code:
    *Run_stored_procedure=spicdata('%App%','%C_Category_Set%','%time_set%','','%entity_set%','','','','','%logtable%','%scopetable%')
    *commit

    step 1.
    Create a store procedure in back end.
    step2.
    Create a ssis package to execute the store procdure.
    step3.
    call this ssis pacakge in the data manager package and run the package.

  • Need Help in with Querying Stored Procedures from UCCX Database

    Hi All
    We are trying to build a custom reporting solution using a BI tool and for which we have provided the ODBC connectivity to the UCCX database to our SQL server.
    We have installed the ODBC drivers on our SQL server and made a connection to UCCX version 10.0 successfully. we are using the username 'uccxhruser' to connect to the DSN.
    We want to query the stored procedure sp_csq_activity from the Microsoft SQL Server Management Studio. When we add the Linked Server in the SQL Server, we are able to see the Data Tables and also query them using the select statement. However, we are not able to see any of the Stored procedures within the Linked Server Tab.
    Can someone guide us in the right direction as to how to go about the process. Is calling the stored proedure the right way or we need to query the individual tables as mentioned in the Database Schema Guide and then once the historical tables our there in our server , then build the report.
    Any help will be much appreciated.
    Regards
    Abhinav

    Hi,
    what happens if you try to execute the above SP? They should be accessible AFAIK.
    G.

Maybe you are looking for