(+351) 21 24 10006  ·  info@bconcepts.pt
Carnaxide, Lisbon

How to Create a VIEW in Synapse Serverless SQL Pool

João Barros 07 de July de 2026 4 min read

Creating a VIEW in the Azure Synapse serverless SQL pool is the simplest way to give a friendly name to a query over files stored in the Data Lake. A view is just a saved query: instead of repeating the storage path and the OPENROWSET function every time, you write the logic once and query it like a normal table. This reduces errors, standardises column names, and makes life easier for everyone on the team who needs the data.

Prerequisites

  • An Azure Synapse Analytics workspace with access to Synapse Studio.
  • An ADLS Gen2 storage account with at least one Parquet or CSV file (for example, vendas.parquet).
  • The Storage Blob Data Reader permission on the container, so your user can read the files.
  • Basic SQL knowledge (SELECT, FROM, and GROUP BY).

Step 1: Open a SQL script on serverless

In Synapse Studio, open the Develop tab, click the + button, and choose SQL script. At the top of the editor, in the Connect to field, select Built-in. This is the serverless endpoint: you don't provision or start anything, and you only pay for the amount of data each query processes. It's ideal for exploring Data Lake files without keeping infrastructure running.

Step 2: Create your own database

You cannot create views in the serverless master database. So first create a database dedicated to your objects. Run the command below and then switch the database selector (next to Connect to) to AnaliseVendas, so the next commands run in the right place.

CREATE DATABASE AnaliseVendas;

Step 3: Test the query with OPENROWSET

Before creating the view, confirm that you can actually read the file. The OPENROWSET function reads data straight from the Data Lake without loading it into any table. BULK points to the path, and the * acts as a wildcard to read several files at once. Replace the URL with your own account and container address.

SELECT TOP 100 *
FROM OPENROWSET(
    BULK 'https://aminhaconta.dfs.core.windows.net/dados/vendas/*.parquet',
    FORMAT = 'PARQUET'
) AS linhas;

If rows appear, access is working. If you get a permissions error, review the Storage Blob Data Reader assignment from the previous step — it's the most common cause.

Tip: with CSV files, add PARSER_VERSION = '2.0' and, if the first row has headers, HEADER_ROW = TRUE inside OPENROWSET.

Step 4: Create the VIEW

With the query validated, wrap it in a view. The CREATE VIEW statement stores the definition in the database. Naming the columns explicitly is good practice: it makes the view stable and predictable, even if the column order in the file changes later.

CREATE VIEW dbo.vVendas AS
SELECT
    linhas.Data,
    linhas.Produto,
    linhas.Quantidade,
    linhas.Total
FROM OPENROWSET(
    BULK 'https://aminhaconta.dfs.core.windows.net/dados/vendas/*.parquet',
    FORMAT = 'PARQUET'
) AS linhas;

Note that inside a view there's no point using unnecessary TOP or ORDER BY: the view should return the full set and leave filtering and sorting to whoever queries it.

Step 5: Query the view

From now on, anyone with access to the database can query the data without knowing where the files are or what the container is called:

SELECT Produto, SUM(Total) AS TotalVendido
FROM dbo.vVendas
GROUP BY Produto
ORDER BY TotalVendido DESC;

The storage path stays hidden inside the view. If you move the files tomorrow, you just change the view once and every query keeps working.

Verify the result

To confirm the view was created successfully, query the system catalog:

SELECT name, create_date
FROM sys.views
WHERE name = 'vVendas';

If the row appears and the SELECT from Step 5 returns totals per product, everything is correct. As an extra check, compare the view's row count (SELECT COUNT(*) FROM dbo.vVendas) with what you expected from the source files.

Conclusion

With a VIEW in the serverless SQL pool you've turned scattered Data Lake files into a simple, reusable interface that's easy to share. It's the foundation for more organised data layers and for giving the team access without exposing technical paths. The natural next step is to create views over partitioned data with the filepath() function, or to define data types with the WITH clause in OPENROWSET. Which query that you repeat every day would be better off as a view?