Azure Data Platform & Structured Storage

Cretaing and provisioning Azure SQL server using new azure portal

https://info.microsoft.com/IN-Azure-WBNR-FY15-04Apr-AzureDataPlatformStructuredStorage-Apr23.html?ls=Website

Visit https://portal.azure.com/

add new

        

open when DB created

use open in Visual studio to create tables in the database

use Price tier to scale DB at runtime

use geo replication…

Switch on auditing

Access database via Sql server management tool or grammatically using EDMX / ADO

CREATE TABLE [dbo].[Person] (

[Id]   [int] IDENTITY(1,1) NOT NULL,

[Name] nvarchar NOT NULL,

[Age] [int] NULL,

PRIMARY KEY CLUSTERED ([Id] ASC)

);

CREATE TABLE [dbo].[Session]

(

[Id] INT NOT NULL PRIMARY KEY IDENTITY,

[SessionName] NVARCHAR(50) NULL,

[PersonId] INT NULL,

CONSTRAINT [FKTableToTable] FOREIGN KEY (PersonId) REFERENCES Person

)

public void TestMethod1()

{

CreateData();

var data  = GetData();

foreach (var d in data)

{

Debug.WriteLine(“{0}: {1}: {2}”, d.Id, d.Name, d.Age);

}

Assert.IsNotNull(data);

}

public void CreateData()

{

using (var dbContext = new demo1Entities())

{

for (int i = 0; i < 10; i++)

{

Person p = new Person() { Age = 20 + i, Name = “abc” + i };

dbContext.People.Add(p);

}

dbContext.SaveChanges();

}

}

public List<Person> GetData()

{

using (var dbContext = new demo1Entities())

{

var q = from p in dbContext.People

select p;

return q.ToList();

}

}

}

[TestMethod]

public void TestMethodUpdate()

{

var data = UpdateData();

Debug.WriteLine(“{0}: {1}: {2}: {3}”, data.Id, data.Name, data.Age, data.Sessions.Count);

Assert.IsNotNull(data);

}

public Person UpdateData()

{

using (var dbContext = new demo1Entities())

{

var q = (from p in dbContext.People

where p.Id ==1

select p).FirstOrDefault();

if (q != null)

{

Session s = new Session() { SessionName = “Azure” };

q.Sessions.Add(s);

dbContext.SaveChanges();

}

return q;

}

}

 

here is the slide deck

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s