SQL Server 2008 and SQL Server 2005 support several new data types. As shown in the following table, these new data types are mapped to compatible data types at the Subscriber if push subscriptions from a SQL Server 2005 or SQL Server 2008 Distributor are used. If new data types are replicated to Subscribers that are running earlier versions of SQL Server, you must verify that the data types are mapped appropriately:
|
SQL Server 2008 data type
|
SQL Server 2005 data type
|
SQL Server 2000 data type
|
|---|
|
Common language runtime user-defined type (UDT): 8000 bytes or less
|
UDT
|
image
|
|
UDT: more than 8000 bytes1
|
varbinary(max)
|
image
|
|
date
2, 3
|
nvarchar(10)
|
nvarchar(10)
|
|
datetime2
2, 3
|
nvarchar(27)
|
nvarchar(27)
|
|
datetimeoffset
2, 3
|
nvarchar(34)
|
nvarchar(34)
|
|
FILESTREAM attribute1, 4
|
varbinary(max)
|
Not supported
|
|
geography and geometry1, 3
|
varbinary(max)
|
image
|
|
hierarchyid
1, 5
|
varbinary(max)
|
image
|
|
nvarchar(max)
|
nvarchar(max)
|
ntext
|
|
time
2, 3
|
nvarchar(16)
|
nvarchar(16)
|
|
varchar(max)
|
varchar(max)
|
text
|
|
varbinary(max)
|
varbinary(max)
|
image
|
|
xml
|
xml
|
ntext
|
1 Mappings for UDT, FILESTREAM, geography, geometry, and hierarchyid types are not supported for transactional publications with updatable subscriptions. Only include these types if all updating Subscribers are running SQL Server 2008 or a later version.
2 Replication does not check the format of data inserted at the Subscriber. Therefore, your application must ensure that inserted data is of the correct format for columns of type date, datetime2, datetimeoffset, and time. This is typically done with a constraint. If the data is not of the correct format, inserts at the Publisher will fail.
3 SQL Server Compact 3.5 Subscribers convert these types after they are replicated to the Subscriber. For information about data type mappings for SQL Server Compact 3.5, see the SQL Server Compact 3.5 documentation.
If you map columns of type geography or geometry to varbinary(max) or image, you cannot replicate default constraints for these columns. This has the following consequences:
4 FILESTREAM is an attribute on a varbinary(max) column. For information about how to use FILESTREAM columns in replicated tables, see the "Replication" section of Using FILESTREAM with Other SQL Server Features. Columns that have the FILESTREAM attribute should not be included in publications that use a character mode snapshot.
5 Support for columns of type hierarchyid depends on the type of replication and the versions of SQL Server that are used. For more information, see the "Using hierarchyid Columns in Replicated Tables" section of hierarchyid (Transact-SQL). For merge replication, hierarchyid is mapped to image when the publication compatibility level is 100RTM and a character mode snapshot is used.