Custom Virtual Table provider with CRUD operations: Creating a table on Azure SQL database – part 2 of 6

after making an introduction and presenting the scenario in the part 1, in this second post I show you how to create the table that has the goal of representing the external system.
In this case I used an Azure SQL database and created a table called Person.

The table have following fields:

  • PersonId to store the Guid
  • FirstName
  • LastName
  • Email

Here is the script SQL to create the table and insert two rows as example:

CREATE TABLE [dbo].[person] (
    [FirstName] NVARCHAR (100) NOT NULL,
    [LastName] NVARCHAR (100) NOT NULL,
    [Email] NVARCHAR (100) NOT NULL

INSERT INTO [dbo].[person] ([PersonId],[FirstName],[LastName],[Email]) VALUES (newid(),'Danilo','Capuano','')
INSERT INTO [dbo].[person] ([PersonId],[FirstName],[LastName],[Email]) VALUES (newid(),'John','Doe','')

In this PoC, for query data I used the Query Editor available as a feature itself on the Azure SQL database:

Hope it helps, follow this serie and happy reading!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.