Parallel Query processing in SQL server

In stored procedure we are processing nearly 10 update statements with in a transaction, because  of synchronous query processing it is taking time to process all these queries ,I need to execute all the quires asynchronous processing can any
one help me out how to process quires asynchronously?

Hi,
For most cases the need of using asynchronous
statements processing
is resolving using Service Broker
SQL Server Service Broker provides native support for messaging and queuing applications in the SQL Server Database Engine. Service Broker, internal or external processes can send and receive guaranteed, asynchronous messaging by using extensions to
Transact-SQL.
SQL Server Service Broker
http://msdn.microsoft.com/en-us/library/bb522893.aspx
An Introduction to SQL Server Service Broker
http://technet.microsoft.com/en-us/library/ms345108(v=sql.90).aspx
[Personal Site] [Blog] [Facebook]

Similar Messages

  • TCP connection closed but a child process of SQL Server may be holding a duplicate of the connection's socket in SQL2008R2

    Hello,
    I do get the below SQL error in production environment intermittently:
    TCP connection closed but a child process of SQL Server may be holding a duplicate of the connection's socket.  Consider enabling the TcpAbortiveClose SQL Server registry setting and restarting SQL Server. If the problem persists, contact Technical
    Support.
    According to the post I search in MSDN, the above error is fixed in SQL2008R-CU6, but I have SQL2008R2-SP02 CU09 patch in production environment and the above error still occurred intermittently. I am running SQL2008R2 SP02 CU09 patch with Windows 2008R2-SP01.
    I would like to know if anyone has  the same error happened to their SQL environment after applied SQL2008R2-SP02 CU06 patch and later.
    Any suggestion would be helpful.
    Best regards,
    PL.

    Hello,
    What happen if you apply the changes on the registry explained on the workaround section of the following article?
    http://support.microsoft.com/kb/2491214
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • Parallel query processing. (Max Processors)

    Hi Guys,
    We have a System running on SQL 2000, and it configured to use all available processors.
    (Server properties>Processor)
    I am about to change it to use 1 processor as per microsoft recommendation, but there another option when you select fixed number of processor instead of all available processors, which is
    "Minimum query plan threshold for considering queries for parallel execution(cost estimate)"
    http://picasaweb.google.com/lh/photo/8N0-WQt3m23vEiupxdjtwQ?feat=directlink
    can anybody suggest me, how do you estimate this number. or you guys can post what is current threshold value in your SQL 2000 server environment. (I dont see this option in SQL 2005,probably its handled automatically).
    Thanks Guys

    Hi Fan Yu
    SAP on Microsoft SQL Server
    In the above document, page 44 under section Max degree of parallesim, microsoft recommends this value to be set to 1.
    (Reasons are discussed in the white paper)
    Like i said, SQL 2000 has one more option regarding max degree of parallelism, i.e "Minimum query plan threshold for considering queries for parallel execution(cost estimate)" 
    http://picasaweb.google.com/lh/photo/8N0-WQt3m23vEiupxdjtwQ?feat=directlink
    Probably i was not clear in my question, this is not related to number of processors and data files, but number of processors used by the query engine at a given  time.(max degree of parallelism).

  • DeadLocks on Query Notifications with SQL Server 2008 SP3

    Hello,
    according to this article https://support.microsoft.com/kb/975090 the issue with deadlocks on query notifications should be fixed with SQL Server 2008 SP3 (10.0.5500.0). But we still get deadlocks in the following manner:
    <resource-list>
    <keylock hobtid="72057598393909248" dbid="5" objectname="MyDB.sys.query_notification_1411013420" indexname="cidx" id="lock1731c1f00" mode="RangeX-X" associatedObjectId="72057598393909248">
    <owner-list>
    <owner id="process573dc8" mode="RangeX-X"/>
    </owner-list>
    <waiter-list>
    <waiter id="process58ddc8" mode="RangeS-U" requestType="wait"/>
    </waiter-list>
    </keylock>
    <keylock hobtid="72057598372872192" dbid="5" objectname="MyDB.sys.query_notification_253437289" indexname="cidx" id="lock800c8780" mode="RangeS-U" associatedObjectId="72057598372872192">
    <owner-list>
    <owner id="process58ddc8" mode="RangeS-U"/>
    </owner-list>
    <waiter-list>
    <waiter id="process573dc8" mode="RangeS-U" requestType="wait"/>
    </waiter-list>
    </keylock>
    </resource-list>
    Is there any need to install another fix?
    Thanks in Advance!

    Hello,
    SQL Server 2008 SP4 and all cumulative updates of SP3 do not have fixes related to deadlocks.
    Maybe the following workarounds and solutions can help in your scenario.
    http://stackoverflow.com/questions/3707137/understanding-deadlocks-with-sql-server-query-notifications
    Deadlock Prevention. In case you need to lock multiple conversation groups in a transaction, you need to take the same order to lock the different conversation groups in all transactions, otherwise you will have a deadlock issues.
    Source:
    http://blogs.msdn.com/b/kangmo/archive/2008/12/17/a-brief-guide-on-sql-server-service-broker.aspx
    Try to may transactions more simple and shorter.
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • Open Query issue in SQL server 2005

    I am running following query in SQL Server 2005, remote connection is Oracle. Query runs perfect in oracle.
    Any help would be greatly appreciated.
    Error is:  
    OLE DB provider "MSDAORA" for linked server "ORACLEROSTER" returned message "ORA-00911: invalid character ".
    select 
    EMPLOYEEID,
    TermDate,
    UserName,
    ACTION,
    DEPTID,
    DESCR
      from OPENQUERY(ORACLEROSTER,
    'SELECT DISTINCT substr(A.EMPLID, 1,10) "EMPLOYEEID" 
    , TO_CHAR(A.EFFDT,"yyyy-mm-dd") "Term Date"
    , SUBSTR(A.NAME, 1, 25) "User Name"
    , SUBSTR(A.ACTION, 1, 10) "ACTION"
    , SUBSTR(A.DEPTID, 1, 10) "DEPTID"
    , SUBSTR(B.DESCR, 1, 20) "DESCR" 
      FROM sysadm.PS_PERSONNEL_HIST A, sysadm.PS_EMPLMT_SRCH_QRY A1, sysadm.PS_DEPT_TBL B, sysadm.PS_SET_CNTRL_REC B2 
      WHERE B.DEPTID = A.DEPTID 
     AND B2.SETCNTRLVALUE = A.BUSINESS_UNIT 
    AND B2.RECNAME = "DEPT_TBL" 
     AND B2.SETID = B.SETID 
     AND A.EMPLID = A1.EMPLID 
     AND A.EMPL_RCD = A1.EMPL_RCD 
     AND A1.ROWSECCLASS = "DPPDIFLD" 
     AND ( A.EFFDT = 
          (SELECT MAX(A_ED.EFFDT) FROM sysadm.PS_PERSONNEL_HIST A_ED 
           WHERE A.EMPLID = A_ED.EMPLID 
           AND A.EMPL_RCD = A_ED.EMPL_RCD 
           AND A_ED.EFFDT <= SYSDATE) 
        AND A.EFFSEQ = 
            (SELECT MAX(A_ES.EFFSEQ) FROM sysadm.PS_PERSONNEL_HIST A_ES 
            WHERE A.EMPLID = A_ES.EMPLID 
              AND A.EMPL_RCD = A_ES.EMPL_RCD 
              AND A.EFFDT = A_ES.EFFDT) 
         AND A.ACTION = "TER" 
         AND A.LOCATION IN ("500","600") 
         AND A.JOBCODE IN ("SR5","SR3","ASR","ASRS","IBP5","IBP3","I53610","I53630","053610","053630") 
         AND A.EFFDT BETWEEN SYSDATE - 7 AND SYSDATE 
         AND A.ACTION_REASON <> "ZNS" 
         AND A.EMPL_STATUS = "T" 
         AND B.EFFDT = 
            (SELECT MAX(B_ED.EFFDT) FROM sysadm.PS_DEPT_TBL B_ED 
            WHERE B.SETID = B_ED.SETID 
              AND B.DEPTID = B_ED.DEPTID 
              AND B_ED.EFFDT <= A.EFFDT) )
      order by 2;')
    s

    How about if you make the query into a view on ORACLE and SELECT from the view?
    Kalman Toth SQL SERVER 2012 & BI TRAINING
    New Book: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2012

  • Oracle query on dblinked SQL Server tables returns ORA-00904 error

    Hi,
    I have created a dblink to a SQL Server database from Oracle using Generic Connectivity.
    The following query returns ORA-00904 Invalid Identifier error in the WHERE clause (tblEmp.Empno)
    SELECT "EmpNo","EmpName", "DeptName"
    FROM tblEmp@sqlserver,
    tblDept@sqlserver
    WHERE tblDept.DeptNo = tblEmp.Empno
    I had to enclose the column names in double quotes due to case sensitivitiy of the columns, but I can't do the
    same for the WHERE clause.
    1) So, how do I fix this error ?
    2) Also how do I include Deptno column with table alias in the columns list?
    (Deptno is ambiguous in Emp and Dept tables)
    Regards,
    Sam

    Alex
    Because using the aliases all the time can become annoying and lead to disparate standards when used by multiple developers. For a one-off query I would go with aliases in the query but if the linked tables are going to be interrogated extensively I would prefer to create vanilla views of the underlying tables so that the aliases aren't necessary.
    Just my opinion, it feels a bit cleaner to do it this way - you only do the work once in creating the view and then you don't need to worry about the case sensitivity of the linked database. You can also refer to the source in the name of the view so you don't have to think about different source databases with the same table names.
    Cheers
    Ben

  • Adding parameter to a MySQL query in MS SQL Server Report Builder

    So I have a MySQL DB connected to MS SQL Server Report Builder via ODBC connector. Everything is fine, I can execute queries and put the fields into report.
    But I can't add an parameter to the query.
    Example query:
    SELECT column1, column2 FROM table WHERE column3 = (@parameter1)
    The result set is just empty. I think the problem is that I'm using MySQL and not MS SQL. Any suggestion?

    Hello Alan,
    Named parameters like @param works with SQL Server / .NET data provider, but not for OleDB, here you have to use the question mark instead
    SELECT column1, column2
    FROM table
    WHERE column3 = ? and column9 = ?
    When you assign the report parameter to query parameter you have to take care about the order of used ? in query
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • Query used by SQL Server Management Pack for monitoring database backups

    I use SCOM 2012 R2 and the SQL Server Management Pack to monitor SQL Server database backups. I believe I am getting false positives. SCOM reports database are not backuped, while in fact they are. So I need to troubleshoot this. I suspect SCOM is querying
    the backup history in the msdb database. I want to know which query SCOM uses.
    I have tried looking in the monitor's definition but I suspect the query is embedded in the management pack files which are binary. I have also tried running a trace using the SQL Server Profiler on my test environment and overriding the interval to 60 seconds,
    but I don't see a relevant query being executed. I also don't see the alert reappear so I suspect SCOM does not honor the interval in a way I would expect.
    What query, or other method, does SCOM use to check database backups?
    Thanks in advance.

    Thank you both Ivan and Michael,
    I only saw your messages by email and didn't see your screen shot before I extracted the query myself. In my own queries I calculate the backup age in hours instead of days because of daily full backups. Perhaps It will be a good idea to create my own monitors
    from scratch like I used to do with Nagios.
    I will study the vbscripts and might create my own version which allows the query to be entered as an parameter and move all code to a .Net class which can be called from vbscript as an COM object. This way I hope to reduce the vbscript code to an minimum
    while keeping the flexibility of the SCOM Operations Console and the robustness of .Net. I suspect I want to make more non standard monitors in the future.
    Regards,
    Arjen

  • Macbook air - parallels Desktop and microsoft SQL server

    I bought a macbook air and parallels desktop+windows 7 to install maxsea (for sea navigation). This software requires SQL server 2008 express SP1. However I can not install SQL server because of an issue on the performance counter.
    How can I fix this issue? is it due to macbook air? (I was able to run this program on a imac+parallels4)
    Thanks

    Hi Timo,
    Thank you for sharing such useful information. It will help for the users who want to install Microsoft SQL Server Data Tools_Business Intelligence for Visual Studio 2013. Are there any problems in your installation? If there are some problems, please post
    the detail error message, so that you can get more help. Please change the type to discussion if there are no any problems.
    Regards,
    Charlie Liao
    TechNet Community Support

  • What is the process for SQL Server 2005 patch update

    hi,
    i have 2 production SQL Server2005  Database servers in cluster ,
    what is the process for applying patches.
    Saidireddy

    In 2005 you can do it in two ways...
    Method 1 :
    With SQL Server 2005,
    when you start installing cluster service pack (or hotfix), it must be launched on the active node(node
    that hosts the instance). When installing the Setup will launch simultaneously  "remote silence" on all passive nodes. All nodes in the cluster containing the SQL Server instance are updated in the same time.
    Method 2: First you can install in passive node then you can install in the active node, In this way you can save your down time ( If you start in the active node it will check in the passive, and if its installed already then it skips that
    and start applying in the active node ), but most of the DBA's follows only first method because they may not aware of this or just they follows Microsoft common method. 
    SQL 2008 and Later....
    1.  Apply the hotfix on pasive node N2
    2.  Reboot the passive node N2
    3.  Failover on SQL resource : the passive node become the active node
    4.  Apply the hotfix on the passive node N1
    5.  Reboot the passive node N1
    Raju Rasagounder Sr MSSQL DBA

  • Trouble Turneing on FileStream/Ad Hoc Query with new SQL Server 2014 64-BIt Version

    SQL Server Help,
    I have recently installed SQL SERVER 2014 on my Window 7 SP1 Acer laptop.
    I am trying to do a simple upload of an Excel file into SQL Server using the OPENROWSET command:
    Which I found requires some configuration change I attempted below.
    When I execute this:
    execute sp_configure 'show advanced options', 1;
    RECONFIGURE;
    execute sp_configure 'Ad Hoc Distributed Queries', 1;
    RECONFIGURE;
    GO
    I get this message
    Configuration option 'show advanced options' changed from 1 to 1. Run the RECONFIGURE statement to install.
    Msg 5593, Level 16, State 1, Line 2
    FILESTREAM feature is not supported on WoW64. The feature is disabled.
    Msg 15123, Level 16, State 1, Procedure sp_configure, Line 62
    The configuration option 'Ad Hoc Distributed Queries' does not exist, or it may be an advanced option.
    Msg 5593, Level 16, State 1, Line 4
    FILESTREAM feature is not supported on WoW64. The feature is disabled.
    When I go to the SQL Server Services and Properties on the Server and try to change the FileStream options to be on..I get the error:
    "There was an unknown error applying the FILESTREAM settings.  Check the parameters are valid (0x80070002)."
    Perhaps my issue is with the Windows Share Name:  .  I have put in a local driver C:\A_Excel....also the computer name, my user ID.   Is there a special format or way to define a Share Name that I am unaware of?
    Is there a way to fix this?  Can I not load Excel files with a 64-Bit system?  Or what is the easiest way that I can do this with my configuration?
    Thanks for any help.

    FILESTREAM feature is not supported on WoW64. The feature is disabled.
    By the error message it seems you have a 64 bit OS, but have installed a 32 bit SQL Server and here in WoW64 mode filestream seems to be not supported. Install a 64 bit SQL Server instead.
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • Data discrepancy between Webi Report and same Query fired on SQL Server 2k5

    Hi ,
    We are facing an issue in BO XI R2.
    We need to run a Webi report in which negative values for forecasting data for year 2011 and 2012 should be displayed.
    When we are running this report for negative values, we are getting message u2018There is no data corresponding to this queryu2019.
    Then we tried executing the same query on Database. Here at db level we got the correct required result.
    So now we are not able to find the reason for data discrepancy .
    Why the same query generated by Webi is providing correct data when fired on reporting database and not when running the Webi Report.
    Checklist we have gone through for this troubleshooting is-
    -Connections of Universe (Is universe pointing to same database or not)
    -Any filter condition present at universe level and at report level.
    Could anyone please help on this.
    Regards,
    Vaibhav

    Vaibhav,
    Have you tried the following when you are in WebI: go under the Edit Query panel, click on the "SQL" icon, and review the query that is getting generated?  At this point you can also click on the "copy" option, then paste this query into your SQL application analyzer and run to see what results are generated.  To me, it sounds like the portion trying to generate the "minus" sign might be getting tripped up causing the disconnect....
    Thanks,
    John

  • Query related to Sql Server

    SQL Server 2012 : We would require a developer license for SQL 2012 Server and there might be 1-2 people accessing the server through SQL Client. This is for non-production use.
    Do we need to buy a CAL license for this or just an additional edition of Developer license will do to access the Server.
    I see that in your licensing document it is mentioned that “One license is required for each person that accesses or uses the software”
    Please reply asap

    Check this 
    Licensing SQL Server for Non-production Use
    The SQL Server 2012 Developer Edition is a full-function version of the SQL Server software—with all the features and capabilities of the Enterprise edition—licensed under the Developer Tools model, which is a "per user" model.
    One license is required for each person that accesses or uses the software.
    When using SQL Server software for development, test or demonstration purposes, only the users are licensed and there is no need for a corresponding license for the actual server systems running SQL Server software in this case.
    As long as only licensed users have access to the software, customers can install as many copies of the software on any number of servers that are used exclusively for development, test or demonstration purposes. This
    is significant, because it allows customers to run the software on multiple devices (for testing purposes, for
    example) without having to license each non-production server system.  
    http://download.microsoft.com/download/7/3/C/73CAD4E0-D0B5-4BE5-AB49-D5B886A5AE00/SQL_Server_2012_Licensing_Quick_Reference_Guide_Mar2012.pdf
    However, You must confirm this with the Microsoft Licensing team if you need quick response on this.
    Check these as well
    http://www.microsoft.com/sql/howtobuy/licensing.mspx
    http://www.microsoft.com/en-in/contact.aspx
    http://blogs.technet.com/b/volume-licensing/archive/2014/03/10/licensing-how-to-when-do-i-need-a-client-access-license-cal.aspx
    Regards, Ashwin Menon My Blog - http:\\sqllearnings.com

  • Query to get sql server version information?

    Hi!
    I'm new to sql and would appreciate it if anyone could show me the query that i need to type to get the server version information - I do not have direct access to the sql database (doing some work on an old website that runs on windows box w/ coldfusion :p)
    appreciate it!

    You could try this.
    Select SERVERPROPERTY('productversion') As [Version],
    SERVERPROPERTY('productlevel') As [Level],
    SERVERPROPERTY('edition') As [Edition]
    It will produce output like this.
    Version Level Edition
    9.00.4035.00 SP3 Developer Edition
    Hope that helps.Nathon Dalton
    Software Developer
    Systems Administrator
    Network Administrator
    Blog: http://nathondalton.wordpress.com

  • Upgrade process for SQL server 2005 service pack4 on stand alone and cluster servers

    Hi All,
    We have iniated a process of upgarding sp4 for all sql 2005 stand alone and clusters servers.
    Please provide me the step by step process for installing sp4 and roll back paln for sql 2005 servers.And before proceeding with sp installation what are the pre check/pro active things that we need to take care.
    Maheshwar Reddy

    Hello,
    For applying SP to SQL 2005 cluster environment/standalone please refer to below link
    http://www.sqlcoffee.com/Tips0007.htm
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

Maybe you are looking for

  • Conditional suppression using substitution variable in Hyperion financial r

    Hi all, Is there a way that I can suppress a column using substitution variable in hyperion financial reporting? For eg, i want to suppress the column if the value of the substitution variable curr_mnth = jun. Is there a way to do this? In conditiona

  • File folder of Adobe reader for android

    When switch to "folder view", there are two folders "0" and "legacy", which are actually the same folder. Is it possible to remove one of the two folders ? When switch to "folder view", it always comes to root folder, is it possible to keep the folde

  • Service Call or CALL FUNCTION

    Hi everyone, what's the difference between invoking a Service Call or Call Function directly from within a WebDynpro ABAP component to execute a BAPI/Function module? Thank you.

  • Changing Item Description in Sales document through programmatically.

    Hi How to change the sales document Item Description programmatically.  I have one customization form, this will open when ever the user tabbed out from Quantity column. In that user form , user might be change the item description. I want to replace

  • Alot of playlists

    My family came over and now i have more then 200 playlist on my itunes n its making my itunes go slow is there a way to highlight all the playlist and delete it at once??please help its making my pc go slow n its making my itunes all cluttery.