开发者

How can I insert data from SQL Server to SQL Azure?

I would like to writ开发者_如何学Ce a query with data based on a SQL Server table and insert the results into a SQL Azure table. Is this possible in SQL Server Management Studio?

For example:

SELECT stuff
INTO AzureTable
FROM SqlServerTable


I suppose it's possible to do something similar to that with a linked server to your SQL Azure host, but using SELECT INTO explicitly will not work - you'd need the destination table to exist first (see this MSDN blog post where they describe why SELECT INTO is not supported in SQL Azure).

If the destination tables don't already exist, you can script the objects in Management Studio (as described here) or use tools like SQL Compare from Red Gate to do the grunt work for you.

Once the destination tables exist, you can just write insert statements (again assuming a linked server) or you could use a slightly different approach. For example, have you looked at the SQL Azure Migration Wizard on Codeplex or SQL Data Compare from Red Gate?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜