×
Namespaces

Variants
Actions
Revision as of 22:16, 18 June 2013 by galazzo (Talk | contribs)

Azure Mobile Services - Importing data from Excel

From Nokia Developer Wiki
Jump to: navigation, search
WP Metro Icon File.png
WP Metro Icon Web.png
WP Metro Icon WP8.png
SignpostIcon WP7 70px.png
Article Metadata
CompatibilityArticle
Created: galazzo (18 Jun 2013)
Last edited: galazzo (18 Jun 2013)

Contents

Introduction

In this article will be shown how to import data from an Excel file into Azure Mobile Services in order to be used by your App. It's assumed you have created your own service else follow this guide on how to manage Azure Mobile Services.

Tools

In order to import data from your local database or Excel file you need to install last version of Microsoft SQL Server Management Studio Express (SSMSE), a free and easy graphical tool to use for managing SQL Server database with Advanced Services.

Sql-server-management-studio.jpg

Importing Data

Opening Microsoft SQL Server Management Studio will be asked to connect to a server.

Sql-server-management-studio-login.jpg

Select the server name you choosed during creation of your Mobile Service and select SQL Server Authentication option.
Once logged you can browse your remote databases, tables and perform queries.

Sql-server-management-remote-db access.jpg

Now we need to access to a local resourse in order to upload data from local to Cloud. To do that click on connect button on top left of the explore object column and select database engine. Will be shown the same window at startup and select your local address ( tipically localhost or network path ) and select Windows authentication.

Sql-server-management-local-db access-2.jpg

if don't have one create a new local database

Sql-server-management-studio-create-local-database.jpgSql-server-management-studio-create-local-database-2.jpg

Right click on your local database -> task -> import data

Sql-server-management-studio-import-data-into-azure.jpg

Opened the import / export wizard, select Microsoft Excel as data origin and the right version of your Excel file

Sql-server-management-studio-import-data-into-azure-2.jpg

The next step is to select the destination server and of course will be our remote Azure Db

Sql-server-management-studio-import-data-into-azure-3.jpg

Select the first option: Copy data from one or more tables or views
Sql-server-management-studio-import-data-into-azure-4.jpg

Now you will be able to see the content of your Excel file. Note that each sheet will be seen as a table

Sql-server-management-studio-import-data-into-azure-5.jpg

Selected the sheet you want to import let's click on Modify Mapping and then on Modify SQL Code

Sql-server-management-studio-import-data-into-azure-6.jpgSql-server-management-studio-import-data-into-azure-7.jpg

Add the following line [id] int identity primary key, into the script. This will be our primary key. Remeber that each table must have a primary key named Id. The code should look like that:

CREATE TABLE [dbo].['TABLE - NAME$'] (
[id] int identity primary key,
[Tipo] nvarchar(255),
[Descrizione] nvarchar(255),
[Immagine] nvarchar(255)
)


Go forward
Sql-server-management-studio-import-data-into-azure-8.jpgSql-server-management-studio-import-data-into-azure-9.jpg

Summary

107 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×