How can I architect my data layer to yield query result pages to the application as SQL Server prepares them?

I tried to make the question as explicit as possible.
Refer to Sql Server Management Studio's Results view.  Depending upon the structure of the execution plan, the Results pane may begin displaying results while the query is still executing.  Can someone point me in a direction for architecting a
data layer (I am tech and framework agnostic for this task. Any solution will suffice) that will begin receiving pages of the set before SQL Server has completed the entire query?
The call from the data layer to SQL Server will obviously have to be asynchronous, but is there any additional ceremony that I need to be aware of when issuing OPTION (FAST x) to the query optimizer?

Thanks for the reply. (I actually meant to put this in the SQL Data Access forum, not the T-SQL forum)
"Generally the last step is ORDER BY in a
query, so nothing can start before that executes."
I would imagine you cannot ORDER BY and yield results as they are fetched because of the execution plan that would be generated.  For the purposes of this post, please assume that sorting will be done purely client side
"Can you post your query?"
 For purposes of discussion, let's assume that the query is
select *
from information_schema.columns
and also assume that you have "lots" of columns to display.
This was an exploratory question to see what would be necessary to replicate the behavior of Management Studio's Query Result view in a custom application. 
I would imagine that there's going to be a lot of analysis of the execution plans that get generated in order for the OPTION (FAST x) optimizer hint to do any good, but apart from general tuning concerns that would allow SQL SERVER to yield a page of data
"fast", I was wondering if there was anything else required of the calling client to force it to yield return its first page.
After thinking about this (and phrasing it the way I did in the last sentence) perhaps this is the incorrect forum for this question.  I imagine that my concerns are better addressed in forums dedicated to the technology of the calling client (which
would be a .NET assembly)
Be that as it may, if there is any ceremony that SQL Server imposes on clients in order to yield return, I would expect that my question would be in the scope of SQL Server discussions (even though I intended this to be in a different SQL Server forum)

Similar Messages

  • How can I get a date picker or wheel to show up in the form to make filling in a form with a lot of

    how can I get a date picker or wheel to show up in the form to make filling in a form with a lot of dates more easy?

    There is no built-in date picker available for forms created in Acrobat. There are some third-party solutions involving JavaScript (either a large collection of fields or a custom dialog) though. Also, text fields with date formatting will use a wheel type date picker on Android/iOS devices with Adobe Reader.

  • How can I tell if data was transferred to my MacBook Pro after the Migration Assistant process was stopped?

    I began Migration Assistant and after about 4hrs into the transfer I decided to quit. How do I find out if any data was transferred to my Macbook Pro from my Windows 7 pc?

    iMac Obsessed wrote:
    I've had my MacBook Pro Retina since the 17th and am only now realising that my firewall was not on. I've already connected to a network via ethernet at my job so that I can have access to the internet. How can I tell if my personal info is safe?
    As long as you are behind a router, you don't need to have your firewall turned on at all, in fact it probably slows your computer and/or internet connection down a bit. The only time you need it is to either protect yourself against intrusion from others on your local network or if you hook your computer directly to a cable / DSL modem. See Thomas Reed's Do I Need a Firewall?

  • In SQL server, how can I pass a date and return on any specific day of the week (e.g. Sunday/Monday/Wednesday, etc.)

    In SQL server, I want to be able to have a function to return the date of any specific day of the week by passing two parameters. E.g.:
    parameter 1: a selected date (e.g. 8/3/2013)
    parameter 2: any specific day of the week (e.g. Wednesday)
    result: should be 7/31/2013 (8/3/2013 is a Sunday in the week 7/28 - 8/3, so the Wednesday should be 7/31/2013)
    then if I want to get Saturday of that week, I can simply change the second parameter to 'Saturday'
    Thanks.

    Wrong forum:
    http://www.microsoft.com

  • Can't Create a Data Source - Failed to test connection. [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied

    Hi there,
    I am having a serious issue with The Power BI Data Management Gateway which I am hoping that someone can help me with.
    Basically I am setting a connection between a Power BI demo site and a SQL 2012 Database based on Azure. The Data Management Gateway and is up and running, and Power BI has managed to connect to it successfuly.
    By following the tutorials at
    here I was able to successful create my Data Connection Gateway with a self-signed certificate.
    However, when trying to create the data source I come into problems. The Data Source Manager manages to successfully resolve the hostname, as per the screenshot below:
    Bear in mind that I exposed the require ports in Azure as endpoints and I managed to modify my hosts file on my local machine so I could access the SQL server hosted in Azure using its internal name -- otherwise I would not be able to get this far.
    However the creation of the data source also fails when trying to created it whilst logged in the SQL server in question:
    The Data Source Manager returns the error when using the Microsoft OLE DB Provider for SQL Server:
    Failed to test connection. [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied
    I tried using the SQL Server Native Client 11.0 instead but I also get an error. This time the error is:
    Failed to test connection. Login timeout expiredA network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.Named Pipes Provider: Could not open a connection to SQL Server [53]. 
    Some considerations
    If I provide an invalid username/password, the Data Source Manager does say that the username and password is incorrect.
    Firewall is turned off in the SQL Server (either way, this error also happens if I try top use the Data Source Manager whilst logged in the SQL Server itself).
    SQL Profiler does not show any attempt of connection.
    The SQL server instance in question is the default one.
    The error happens regardless if I select the option to encrypt connection or not.
    In SQL Configuration manager I can see that all protocols are enabled (TCP/IP, Named Pipes and Shared Memory.
    The Event Viewer does not provide any further errors than the one I have copied in this post.
    I'm at a loss here. Could someone please advise what might I be doing wrong?
    Regards,
    P.

    Here is what I had to do to solve this issue:
    Basically I had to add the MSSQL TCP/IP port as an end-point in Azure. After I did that, then I was able to create the data-source. However, I was only able to authenticate with a SQL account, as any domain account would return me an error saying that the
    domain isn't trusted.
    What puzzles me here is how come the Data Source Manager would inform me that an account username/password was invalid, but it would fail/timeout if I provided valid credentials (!?!?!!?)

  • How can I get my Indesign script to apply to all pages in the document?

    My script (java) shown below will only apply to the first page of the document. How can i get it to apply to all pages of my document? What am I missing? Thanks.
    scirpt:
    myDocument = app.activeDocument
    with (myDocument.pages.item(0).marginPreferences){
    columnCount = 1;
    //columnGutter can be a number or a measurement string.
    columnGutter = "0";
    bottom = "0"
    //When document.documentPreferences.facingPages == true,
    //"left" means inside; "right" means outside.
    left = "0"
    right = "0"
    top = "0"
    inside = "0"

    Hi,
    You have to iterate through all pages.marginPreferences:
    var
      myDocument = app.activeDocument,
      allPagesMaPref = myDocument.pages.everyItem().marginPreferences,
      curPageMaPref;
    while ( curPageMaPref = allPagesMaPref.pop() )
      with (curPageMaPref) {
      columnCount = 1;
      //columnGutter can be a number or a measurement string.
      columnGutter = "0";
      bottom = "0"
      //When document.documentPreferences.facingPages == true,
      //"left" means inside; "right" means outside.
      left = "40"
      right = "0"
      top = "0"
      inside = "0"
    Jarek

  • How can I get qucken data from windows copied over to quicken for the Mac?

    I recently bought a Macbook Pro. I have been using windows my whole life. I installed Quicken 2006 for the MAC. I backed up my windows quicken on a disk and it just doesn't open it. Is there a trick? or am I screwed?

    Unfortunately, there is no simple way to convert a Quicken/WIndows data file to Quicken/Mac. This is a major complaint of a lot of switchers.
    I can't find the link (I'll keep looking) but I know that Intuit offers a conversion service. You send them your data file, and for an absurd amount of money they'll convert the file for you.
    You're probably better off starting your Quicken/Mac file from scratch.
    That's what I did. It took some time to do, but now I'm happy with it and I didn't have to pay anyone to convert the file.

  • How can I see my book in portrait as a single page of the landscape view??

    I created my book in landscape mode and when i realized that in portrait mode i could see only a text flow with the widgets on the left i whas very worried!
    Do you think i can realize a portrait view of my landscape view single paged???
    Thank you so much!!!

    I'm using a template that i have modified and i've saved it as a new template!
    Maybe i've found to modify the PDF vectorials with Illustrator but very long and sad...

  • How can I turn a phrase into a hyperlink to a page within the same iBook?

    I tried the link inspector in all ways I could see, but could not find a way to make a phrase a link to another page or heading within the same book in iBook Author (which is very easy in HTML).

    After posting the question, I saw in the right side bar a previous question raising the same issue. In fact, it solves it!

  • Oracle Forms - How can I create a Data Block with query

    Dear friends I have a question, I couldn't do this..
    I have a sql query, I want to show the datas of the query.. How can I do this. ?
    Data Block Wizard wants a table, view or stored procedure, but I have a query, how can I create a data block with my query.. I m waiting your helps..? Please...
    Semih

    Hi,
    You have two options
    1. create a view and base the block on the view
    2. create a block with a query Data Source Type of 'FROM clause query'
    Hope this helps
    Neil

  • How can i edit a date

    how can i edit a date or a address

    no header on page to use just my converted page or invation  just need to change date

  • How can I get unlimited data for my iPad mini

    HOw can I get unlimited data for my iPad mini

    That is completely up to your cellular carrier.  Contact them and ask.

  • My battery died and then when i charged the phone it is asking me to connect to itunes and restore. if i restore how can i get my data back

    My iphone battery died and on charging the phone it asked me to connect to itunes and restore the phone.
    If i restore the phone how can i get my data back and how can i check when i last backed up my phone

    If you have been syncing regularly as the iphone is designed, then you can sync the data back.
    Regardless you will have to restore the iphone.

  • I lost my iPhone device, how can I get my data back on another one without using an iCloud backup just back up on i Tunes, Please Help.

    I lost my iPhone device, how can I get my data back on another one without using an iCloud backup just back up on i Tunes, Please Help.??

    You can find the backup files and then copy them to a safe place if you are worrying about this.
    iTunes places the backup files in these places:
    Mac: ~/Library/Application Support/MobileSync/Backup/
    The "~" represents your Home folder. If you don't see Library in your Home folder, hold Option and click the Go menu.
    Windows Vista, Windows 7, and Windows 8: \Users\(username)\AppData\Roaming\Apple Computer\MobileSync\Backup\
    To quickly access the AppData folder, click Start. In the search bar, type %appdata%, then press Return.
    Windows XP: \Documents and Settings\(username)\Application Data\Apple Computer\MobileSync\Backup\
    To quickly access the Application Data folder, click Start, then choose Run. In the search bar, type %appdata%, then click OK.

  • How can I restore my data from iCal? I didn't make any backup, but I use  time machine with an external HD. I deleted iCal when I deleted my gmail account. I have tried to restore, but I can only restore the iCal software and not the data.

    How can I restore my data from iCal? I didn't make any backup, but I use  time machine with an external HD. I deleted iCal when I deleted my gmail account. I have tried to restore, but I can only restore the iCal software and not the data.

    So what is your question?
    If you forgot your encryption password:
    Warning: Make sure it's a password you will remember or write it down for safekeeping. If you encrypt an iPhone backup in iTunes and forget your password, you can't restore from backup and your data will be unrecoverable.
    If you can't remember the password and want to start again, you must perform a full software restore and chooseset up as a new device when iTunes prompts you to select the backup from which to restore.
    The above comes from here:
    http://support.apple.com/kb/HT4946

Maybe you are looking for

  • Problem in Assigning the Business System

    Hi,    I have problem in Assigning the Business System at Configuration when I am trying to configure the Communication Channel. I had created two Software Components and also Two Technical Systems (Third Party) and Business System and I imported the

  • Are there any tools for optimizing placement of Airport Base Station

    I have both a Airport Extreme B/G and a Airport Extreme N unit. I also have several Airport Express units on the network. Does any one know of any tools (Hardware or Software) that can be used to identify the best physical placement of Airport Units

  • How to use sql in region footer

     

  • Use and impact of the logical system (SCC4)

    An error has been made in our SAP system (production environment), transaction SCC4. The field «Logicial system» has been changed from «PRD460» to «QAS460». It has been left this way for few weeks and when we realized the mistake, we changed it back

  • Confirmation of services= Finance can not process it.

    Hi Guys, For return to vendor here is our process. PO get created Then delivery get generated And then when we PGI , it is not creating any material document and accountng document. Just a confirmation of service. So it is blocked in Finance. Can can