I am trying to transfer one table's data from one server to another.
The table structure on both servers are identical:
CREATE TABLE [dbo].[_CachedQueriesArchive](
[id] [int] NULL,
[statement_text] [varchar](max) NULL,
[execution_count] [bigint] NULL,
[avg_logical_reads] [bigint] NULL,
[last_logical_reads] [bigint] NULL,
[min_logical_reads] [bigint] NULL,
[max_logical_reads] [bigint] NULL,
[plan_handle] [varbinary](64) NULL,
[query_plan] [xml] NULL,
[cursor_type] [varchar](max) NULL
I am using
bcp DBNAME.._CachedQueriesArchive out e:\temp\cq.dat -N -T
statement to export data.
bcp DBNAME.._CachedQueriesArchive in e:\temp\cq.dat -N -T
All records were imported successfuly.
The issue is that column "query_plan" (of "xml" type) is filled in source DB in all 22 records. But in target DB it is filled only in 2 (two!) records. Other columns were imported perfectly.
Tried bcp with -e option. The error file was empty.
BULK INSERT [_CachedQueriesArchive]
FROM 'e:\temp\cq.dat' WITH (DATAFILETYPE='widenative')
for import - same result.
Tried bcp with -w option instead of -N. No success.
Tried importing file on the source server - everything was fine (all 22 records was imported with their "query_plan" data). The problem occurs only on target server.
Servers have different versions:
source - 9.0.3257
target - 9.0.4053
View Complete Post