I've seen answers for the 'create table if not exists' questions for Microsoft SQL Server (for instance, CREATE TABLE IF NOT EXISTS equivalent in SQL Server)
However this doesn't work for Azure databases - not sure if there's no access to sysobjects or the information schema, but I can't find a reliable way to find out if a table has already been created, and if it has not, to then create the table. It appears that you have to have access to master for this to work.
When I try this query (from the solution in the aforementioned link) on Azure, it fails:
if not exists (select * from sysobjects where name='cars' and xtype='U')
create table cars (
Name varchar(64) not null
)
go
Error:
Msg 262, Level 14, State 1, Line 2
CREATE TABLE permission denied in database 'master'.
Any idea how to do this on Azure?