Business Central

Thursday 5 November 2015

Virtual tables, Temporary tables, System tables

Virtual tables : They're created by the system at runtime. The tables are read-only, information present in these tables cannot be changed.

It do not store physical information in database.

You cannot insert, modify, delete information in virtual tables.

You cannot view the virtual table or run it from table object designer. But, however you can create a page with source table view property as any virtual table name and run it.

Example:

Consider a date virtual table, Its existence is virtual not visible in object designer. But when we create a page with source table view as "Date" table. We can see the values of Date virtual table in role centered page.

fig. below explains the virtual table in detail.

Create a page with a name 'Date virtual list' and give a source table view as "Date".


when you run the above page you can see the following data's inside the "Date table"





Temporary Tables: (Memory-based table)

They're not physical tables in database. All interaction in a table occurs in memory on service tier.

We make tables as temporary tables so that the processing will be fast. There will be no load on SQL server and network service. It is same as normal tables but the information will be lost once the table is closed.

Commit doesn't affect any temporary tables and error doesn't roll back any changes to temporary tables.

fig. below explains in detail on how to make a table as temporary table.




go to any table designer and  Go to view -> C/AL Globals. Choose a variable with record type and select any table.

Shift+f4 or select properties and make temporary table as 'yes' as shown in fig. below.





System Tables:

We can see the system tables in object designer just like normal table. But, system tables are created automatically whenever we create a database.

When you click on File -> Database -> New

The following dialog will appear,


When you click ok you can see System tables. Fig. shows various system tables present in database.





These tables will be present in each and every database to track system related information like checking active session, setting up permission, check user. You can modify, add/delete data in these tables.


System Tables:

They store physical information in database. Created automatically by NAV.
You can customize, read, write, change, insert, delete information contained in them.
* Security Permission
* Permission Set



1 comment:

  1. Thank you sooooo much for this Blog. I was searching for examples all over the internet. I was confused between the terms "System Tables" and "Virtual Tables". Microsoft Documentation doesn't explicitly give an example of each of these types. For the longest time I thought Virtual and System Tables are the same.

    ReplyDelete