In “regular” SQL, we can create tables by sending queries like:
CREATE TABLE table_name
(
column_name1 data_type,
column_name2 data_type,
column_name3 data_type,
....
)
… and can copy tables as such:
CREATE TABLE new_table AS (SELECT * FROM old_table);
Now skip over to the Windows Azure Mobile Services world, and its “special” SQL. I am having good success creating tables using the Azure portal (non-programmatically) and then accessing these tables as such:
var mobClient = new MobileServiceClient("[url]", "[app key]");
var mobTable = mobClient.GetTable<MyTableClass>();
Browsing the intellisense for the client showed no options for create or copy table.
Is it possible in Windows Azure Mobile Services, and its unique brand of SQL, to create new tables or copy existing ones, programmatically from the app? Anyone know how?
Thank you.
I actually found out on msdn from Microsoft that this is not possible with Azure today. I submitted it as a feature request.
One nice feature, which I have been using, is the dynamic schema. If you have a table definition class in your project in Visual Studio, whose name matches an Azure table, when you make a change to your VS class, the Azure SQL table updates automatically. You still have to double check and fine tune things, but is still handy.
You enable dynamic schema on this page:
