SAP HANA Development

SAP HANA hdbtable and hdbview: Design-Time Objects and Troubleshooting

Learn how SAP HANA .hdbtable and .hdbview artifacts work, when to use each, how they differ from calculation views, and how to troubleshoot activation and deployment problems.

hdbtable and hdbview at a glanceShow the different roles, inputs, and outputs of the two design-time artifactshdbtable and hdbview at a glanceShow the different roles, inputs, and outputs of the two design-time artifactscreates or updates tablecreates or updates view.hdbtableDefines adatabase….hdbviewDefines aSQL view tha…CatalogobjectThe deployedtable or view…CertPas original visual explanation
Comparison showing that hdbtable defines a stored table and hdbview defines a SQL-derived view, both resulting in deployed catalog objects
On this page
  1. What hdbtable and hdbview do
  2. How an hdbtable artifact is structured
  3. How an hdbview artifact is structured
  4. hdbview and calculation view differences
  5. Deployment and activation workflow
  6. Troubleshooting activation failures
  7. Managing changes safely
  8. Operational checklist

What hdbtable and hdbview do

In SAP HANA development, .hdbtable and .hdbview files describe database objects as design-time artifacts. A deployment or activation process reads the definition and creates or updates the corresponding catalog object in the target schema.

An .hdbtable artifact defines a table, including its columns, data types, keys, and selected table properties. An .hdbview artifact defines a SQL view through a query over existing database objects. The two artifacts therefore have different ownership and lifecycle characteristics: a table stores data, while a view derives a result from other objects.

For broader context, see the SAP HANA development overview, which places these artifacts alongside other development approaches.

Troubleshoot hdbtable and hdbview activationProvide an operational sequence for isolating deployment and activation failuresTroubleshoot hdbtable and hdbview activationProvide an operational sequence for isolating deployment and activation failuresbeginidentify failing objectif definition is validafter dependencies are readyActivationfailsThedesign-time…Read thefirst log…Use theearliest…Validate thedefinitionChecksyntax,…CheckdependenciesConfirmschemas,…Redeploy andtestActivate thecorrected…CertPas original visual explanation
Troubleshooting flow from an activation failure through log review, definition validation, dependency checks, and redeployment testing

How an hdbtable artifact is structured

An .hdbtable file expresses the table definition in design-time form. A basic definition normally includes the table type, columns, and primary key information where a key is required by the application model.

tableType = COLUMNSTORE;
columns = {
    ID       = { sqlType = INTEGER; };
    NAME     = { sqlType = NVARCHAR; length = 100; };
    CREATED  = { sqlType = DATE; };
};
primaryKey.pk = ["ID"];

Use column-store tables for analytical and general-purpose workloads that fit SAP HANA's columnar processing model. Choose data types and lengths deliberately because changing a design-time definition can trigger a table alteration, data movement, or an activation failure depending on the change.

A table artifact should also have a clear dependency boundary. Keep application-owned tables separate from generated or externally managed objects, and use stable names for keys and columns so dependent views do not break during routine deployments.

How an hdbview artifact is structured

An .hdbview file represents a SQL view whose definition is evaluated against source tables or other compatible database objects. A typical artifact identifies the target schema and supplies a query.

schema = "APP_SCHEMA";
query = "select ID, NAME from APP_SCHEMA.CUSTOMER";

The query must reference objects that are available in the target deployment context. Dependencies can include tables, other views, synonyms, and objects delivered by a separate application component. The deployment order must make those dependencies available before the view is activated.

Keep the view projection intentional. Selecting only the columns needed by the consuming service reduces coupling and makes later table changes easier to manage.

hdbview and calculation view differences

An .hdbview is a SQL view definition. Its logic is expressed as a SQL query, and its behavior follows SQL view semantics. A calculation view is a separate modeling artifact with graphical or SQL-based nodes, metadata, semantics, and analytical modeling options.

Use an .hdbview when a readable SQL projection, join, filter, or reusable relational abstraction is sufficient. Use a calculation view when the model needs calculation-view semantics, reusable nodes, measures, dimensions, input parameters, or a structured analytical model. The SAP HANA calculation views guide explains the separate calculation-view workflow.

The choice should follow the consumer and the model's required behavior rather than the file extension alone. A view used by a transactional service may benefit from a small SQL definition, while an analytical model may need the richer metadata and modeling features of a calculation view.

Deployment and activation workflow

Treat an artifact deployment as a dependency graph rather than as an isolated file copy. A practical sequence is:

  1. Create or update the table definition.
  2. Deploy the table artifact to the intended schema.
  3. Confirm that the table is active and contains the expected columns.
  4. Deploy the view artifact.
  5. Validate the view definition and test it with representative data.
  6. Deploy dependent services or models after the database objects are active.

Design-time source files and catalog objects have different lifecycles. A file can be present in a project while its database object is missing, inactive, or still based on an older deployment. Always verify the target system and schema before concluding that a deployment completed successfully.

For projects that use SQLScript alongside database artifacts, the SAP HANA SQLScript procedures guide provides related implementation context.

Troubleshooting activation failures

Activation failures usually come from a small set of operational causes: an invalid definition, a missing dependency, insufficient privileges, an unavailable schema, or an incompatible change to an existing object.

Start with the activation log and identify the first reported object failure. Later errors often result from that initial failure. Check the exact target schema, object names, quoted identifiers, data types, key definitions, and referenced columns before changing the artifact.

For an .hdbtable failure, inspect column definitions, key syntax, duplicate column names, unsupported properties, and changes that conflict with existing data. For an .hdbview failure, inspect the query independently, confirm that every source object exists, and verify that referenced columns and aliases are unambiguous.

When the project uses a containerized deployment model, review the dependency declarations and grants that make external objects available. The SAP HANA HDI containers guide covers the related container-based deployment concepts.

Managing changes safely

Plan table changes according to their effect on existing data. Adding a nullable column is generally easier to roll out than changing a populated column's type, reducing its length, or replacing a key. Test destructive or data-rewriting changes against a copy of representative data before applying them to a shared system.

For views, preserve the contract expected by consuming applications. Renaming a projected column, changing its data type, or altering null behavior can break services even when the view still activates successfully.

Use version control for both artifacts and deployment configuration. Record the intended schema, dependency order, and compatibility impact in the same change so another operator can reproduce the deployment and diagnose a failure.

Operational checklist

Before deploying an .hdbtable or .hdbview change, verify the following:

  • The artifact belongs to the intended application component.
  • The target schema and deployment destination are correct.
  • Referenced tables, views, synonyms, and grants are available.
  • Table keys and column definitions match the consuming code.
  • View projections preserve the expected interface.
  • Existing data has been considered for table alterations.
  • The activation log has been reviewed after deployment.
  • A representative query or service test has succeeded.

This checklist separates source-control validation from database validation. Both are needed because a syntactically valid artifact can still fail when its target dependencies or privileges are incomplete.

Back to all articles