---
title: Use SQL Temporary Tables and then Create a Report with a VDF WinReport Object
description: You can create temporary tables at runtime to store intermediate results from complex queries and greatly improve your performance.
---

[Mertech Blog ](https://www.mertech.com/blog)

# [Use SQL Temporary Tables and then Create a Report with a VDF WinReport Object](https://www.mertech.com/blog/how-to-use-ms-sql-server-temporary-tables-together-a-visual-dataflex-winreport-object)

 Written by [Mertech](https://www.mertech.com/blog/author/mertech) | Feb 24, 2008 10:02:00 PM

You can create temporary tables at runtime to store intermediate results from complex queries and greatly improve your performance.  

*Note: Different SQL databases have different options for dealing with the scope (local or global) and lifetime of temporary tables. Refer to the online documentation for your particular database*. 

Download the code example here:  [Temporary Tables Report in VDF](https://www.mertech.com/hubfs/TempTable.zip)

The example contains code for both MS SQL and ORACLE. The example retrieves information from the CUSTOMER table (which should be present on your server), stores the results in a temporary table, and then uses the VDF WinReport Object to create the following report:

<https://www.mertech.com/hubfs/Imported_Blog_Media/ReportfromTempTable.png>

 

[View full post](https://www.mertech.com/blog/how-to-use-ms-sql-server-temporary-tables-together-a-visual-dataflex-winreport-object)

```json
{
  "@context" : "http://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "Mertech"
  },
  "dateModified" : "2018-02-27T21:12:20.056Z",
  "datePublished" : "2008-02-24T22:02:00Z",
  "headline" : "Use SQL Temporary Tables and then Create a Report with a VDF WinReport Object",
  "image" : {
    "@type" : "ImageObject",
    "height" : 216,
    "url" : "https://static.hsstatic.net/BlogImporterAssetsUI/ex/missing-image.png",
    "width" : 288
  },
  "mainEntityOfPage" : "https://www.mertech.com/blog/how-to-use-ms-sql-server-temporary-tables-together-a-visual-dataflex-winreport-object",
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "height" : 60,
      "url" : "/hs/hsstatic/content_shared_assets/static-1.4092/img/default-amp-logo.png",
      "width" : 60
    },
    "name" : "Blog"
  }
}
```