将数据库从SQL Server导出到Azure

时间:2014-08-08 18:07:53

标签: sql sql-server azure

尝试导出(使用SQL Server的导出工具)。 该过程以错误结束,因为所有表都有以下错误:

Error 0xc0209029: Data Flow Task 1: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR.  
The "input "Destination Input" (194)" failed because error code 0xC020907B occurred, 
and the error row disposition on "input "Destination Input" (194)" specifies failure on error. 
An error occurred on the specified object of the specified component.  
There may be error messages posted before this with more information about the failure.
(SQL Server Import and Export Wizard)


Error 0xc0202009: Data Flow Task 1: SSIS Error Code DTS_E_OLEDBERROR.  
An OLE DB error has occurred. Error code: 0x80004005.
An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 11.0"  
Hresult: 0x80004005  Description: "Tables without a clustered index are not 
supported in this version of SQL Server. Please create a clustered index and 
try again.".
(SQL Server Import and Export Wizard)

2 个答案:

答案 0 :(得分:1)

该消息表明您在其中一个表上没有聚集索引:

"Tables without a clustered index are not 
supported in this version of SQL Server. Please create a clustered index and 
try again."
无法在Azure中创建

SQL Azure requires that every table has a clustered index和没有索引的表。

因此,您必须检查现有数据库,确保所有表都具有聚簇索引。对于那些没有它的人,创建它。然后尝试再次导出到SQL Azure。

运行此命令将聚簇索引添加到表中:

CREATE CLUSTERED INDEX Table1_Index ON Table1 (Col1)

此要求的原因是数据复制。为了在不同服务器之间有效地复制数据,表必须以二叉树结构正确排序数据页。如果没有聚簇索引(在堆表中),复制就变成了一场噩梦。请参阅this blog post

中的详细信息

here is the list SQL Azure限制

答案 1 :(得分:0)

首先,生成表脚本而不应用本地的任何索引并在azure上运行。然后,应用聚簇索引。它会起作用。