This project is read-only.

Azure Stream Analytics can output data to Azure SQL Database, Azure Blob storage, and Azure Event Hub. For the AzureEventHubSample solution, we will define a job that outputs to an Azure SQL Database.

Setting up Azure SQL Database

If you already have an Azure SQL Database, skip this section.

  1. From the Management portal, click NEW, DATA SERVICES, SQL DATABASE, QUICK CREATE. Specify a database name on an existing or a new SQL Database server.
  2. Select the newly created database
  3. Make sure the server-level firewall settings enable you to connect to the database. You can do this by adding a new IP rule under the Server's Configure tab. For more details, including how to handle dynamic IP, see http://msdn.microsoft.com/en-us/library/azure/ee621782.aspx.

Create output tables

  1. Open Visual Studio or SQL Server Management Studio.
  2. Connect to the Azure SQL Database.
  3. Use the following T-SQL statements to create two tables to your database:

    CREATE TABLE [dbo].[LotSensorStream] (
        [HomeHubId]     NVARCHAR (50)  NULL,
        [SensorName]    NVARCHAR (150) NULL,
        [SensorRole]    NVARCHAR (150) NULL,
        [SensorData]    NVARCHAR (150) NULL,
        [EntryDateTime] DATETIME2 (7)  NULL
    );

    GO
    CREATE CLUSTERED INDEX [LotSensorStream]

    ON [dbo].[LotSensorStream]([HomeHubId] ASC);

     

     

Last edited Feb 12, 2015 at 1:39 AM by dannyh206, version 1

Comments

No comments yet.