简体   繁体   中英

How to take Data and Database from SQL Server 2008 R2 and upload to Azure

I have generated scripts from my database that are data only and SQL Azure Database as a Script for Database Engine Type how ever when I publish the application to Azure, I get the following error:

Cannot find the object "dbo.Location" because it does not exist or you do not have permissions. http://go.microsoft.com/fwlink/?LinkId=178587

A piece of my sample data looks like such:

    SET IDENTITY_INSERT [dbo].[Location] ON
INSERT [dbo].[Location] ([id], [name], [type], [unmanned], [authorized], [region], [address], [latitude], [longitude], [phone], [tollfree], [fax], [summerMondayToFriday], [summerSaturday], [summerSunday], [summerHolidays], [winterMondayToFriday], [winterSaturday], [winterSunday], [winterHolidays], [yearRoundMondayToFriday], [yearRoundSaturday], [yearRoundSunday], [yearRoundHolidays]) VALUES (1, N'Alix', N'Petroleum Location', 0, 0, N'Central Alberta', N'Highway #12', CAST(52.39 AS Decimal(18, 2)), CAST(-113.18 AS Decimal(18, 2)), N'403-747-2411', N'', N'403-747-2491', N'6:00 AM - 9:00 PM', N'7:00 AM - 9:00 PM', N'7:00 AM - 9:00 PM', N'7:00 AM - 9:00 PM', N'', N'', N'', N'', N'', N'', N'', N'')

What am I doing wrong?

in the publish settings I am using the context to execute code first migrations AND default database with update database using the sql script I generated from the database

Some one suggested

Some one suggest I do a search and replace and put INTO into to my script:

Incorrect syntax near the keyword 'INTO'. http://go.microsoft.com/fwlink/?LinkId=178587

From the error you listed my guess is that the target table does not exist in the SQL Azure database you are attempting to insert records into. Are you certain that your schema has been deployed to the target database in SQL azure?

You might consider using the SQL Database Migration Wizard to get you started.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM