From c2b5e5b245989a17599ca260e41fb17a125f026b Mon Sep 17 00:00:00 2001 From: Kushaal Shroff <51415286+KushaalShroff@users.noreply.github.com> Date: Fri, 16 Jun 2023 13:46:20 +0530 Subject: [PATCH] Fix Crash in FetchMoreBcpData (#1549) We are crashing here when the implicit batching of packets is happening at the very first phase i.e. reading column metadata phase because the table itself has huge number of columns. Inherently TDS is in a "miscellaneous" mem context during FETCH phase and the allocated pointer thus seems to crash for invalid context during pfree. To fix this we are appending the new packet's data during the FETCH phase rather than freeing the message data which we do in the PROCESS phase. Signed-off-by: Kushaal Shroff --- .../src/backend/tds/tdsbulkload.c | 111 +++++++++++------- test/dotnet/ExpectedOutput/bcp-500-cols.out | 13 ++ test/dotnet/input/InsertBulk/bcp-500-cols.txt | 13 ++ 3 files changed, 94 insertions(+), 43 deletions(-) create mode 100644 test/dotnet/ExpectedOutput/bcp-500-cols.out create mode 100644 test/dotnet/input/InsertBulk/bcp-500-cols.txt diff --git a/contrib/babelfishpg_tds/src/backend/tds/tdsbulkload.c b/contrib/babelfishpg_tds/src/backend/tds/tdsbulkload.c index fbe82ef7e3..a51ea08755 100644 --- a/contrib/babelfishpg_tds/src/backend/tds/tdsbulkload.c +++ b/contrib/babelfishpg_tds/src/backend/tds/tdsbulkload.c @@ -30,7 +30,7 @@ static StringInfo SetBulkLoadRowData(TDSRequestBulkLoad request, StringInfo message); void ProcessBCPRequest(TDSRequest request); -static void FetchMoreBcpData(StringInfo *message, int dataLenToRead); +static void FetchMoreBcpData(StringInfo *message, int dataLenToRead, bool freeMessageData); static void FetchMoreBcpPlpData(StringInfo *message, int dataLenToRead); static int ReadBcpPlp(ParameterToken temp, StringInfo *message, TDSRequestBulkLoad request); uint64_t offset = 0; @@ -70,12 +70,26 @@ do \ temp->rowCount, colNum + 1, temp->colMetaData[i].columnTdsType))); \ } while(0) -/* Check if Message has enough data to read, if not then fetch more. */ -#define CheckMessageHasEnoughBytesToRead(message, dataLen) \ +/* + * Check if Message has enough data to read column metadata. + * If not then fetch more. + */ +#define CheckMessageHasEnoughBytesToReadColMetadata(message, dataLen) \ +do \ +{ \ + if ((*message)->len - offset < dataLen) \ + FetchMoreBcpData(message, dataLen, false); \ +} while(0) + +/* + * Check if Message has enough data to read the rows' data. + * If not then fetch more. + */ +#define CheckMessageHasEnoughBytesToReadRows(message, dataLen) \ do \ { \ if ((*message)->len - offset < dataLen) \ - FetchMoreBcpData(message, dataLen); \ + FetchMoreBcpData(message, dataLen, true); \ } while(0) /* Check if Message has enough data to read, if not then fetch more. */ @@ -87,7 +101,7 @@ do \ } while(0) static void -FetchMoreBcpData(StringInfo *message, int dataLenToRead) +FetchMoreBcpData(StringInfo *message, int dataLenToRead, bool freeMessageData) { StringInfo temp; int ret; @@ -107,17 +121,30 @@ FetchMoreBcpData(StringInfo *message, int dataLenToRead) (errcode(ERRCODE_PROTOCOL_VIOLATION), errmsg("Trying to read more data than available in BCP request."))); - temp = makeStringInfo(); - appendBinaryStringInfo(temp, (*message)->data + offset, (*message)->len - offset); + /* + * If we are trying to read next packet and freeMessageData is true then + * afford to free it. + * NOTE: We should free the message data only while reading + * rows' data and on the other hand we should not free the + * column-metadata information until we are done with it. + */ + if (freeMessageData) + { + temp = makeStringInfo(); + appendBinaryStringInfo(temp, (*message)->data + offset, (*message)->len - offset); - if ((*message)->data) - pfree((*message)->data); - pfree((*message)); + if ((*message)->data) + pfree((*message)->data); + pfree((*message)); + offset = 0; + } + else + temp = *message; /* * Keep fetching for additional packets until we have enough data to read. */ - while (dataLenToRead > temp->len) + while (dataLenToRead + offset > temp->len) { /* * We should hold the interrupts until we read the next request frame. @@ -139,7 +166,6 @@ FetchMoreBcpData(StringInfo *message, int dataLenToRead) } } - offset = 0; (*message) = temp; } @@ -228,7 +254,7 @@ GetBulkLoadRequest(StringInfo message) for (int currentColumn = 0; currentColumn < colCount; currentColumn++) { - CheckMessageHasEnoughBytesToRead(&message, COLUMNMETADATA_HEADER_LEN); + CheckMessageHasEnoughBytesToReadColMetadata(&message, COLUMNMETADATA_HEADER_LEN); /* UserType */ memcpy(&colmetadata[currentColumn].userType, &message->data[offset], sizeof(uint32_t)); offset += sizeof(uint32_t); @@ -249,12 +275,12 @@ GetBulkLoadRequest(StringInfo message) case TDS_TYPE_MONEYN: case TDS_TYPE_DATETIMEN: case TDS_TYPE_UNIQUEIDENTIFIER: - CheckMessageHasEnoughBytesToRead(&message, FIXED_LEN_TYPE_COLUMNMETADATA_LEN); + CheckMessageHasEnoughBytesToReadColMetadata(&message, FIXED_LEN_TYPE_COLUMNMETADATA_LEN); colmetadata[currentColumn].maxLen = message->data[offset++]; break; case TDS_TYPE_DECIMALN: case TDS_TYPE_NUMERICN: - CheckMessageHasEnoughBytesToRead(&message, NUMERIC_COLUMNMETADATA_LEN); + CheckMessageHasEnoughBytesToReadColMetadata(&message, NUMERIC_COLUMNMETADATA_LEN); colmetadata[currentColumn].maxLen = message->data[offset++]; colmetadata[currentColumn].precision = message->data[offset++]; colmetadata[currentColumn].scale = message->data[offset++]; @@ -264,7 +290,7 @@ GetBulkLoadRequest(StringInfo message) case TDS_TYPE_NCHAR: case TDS_TYPE_NVARCHAR: { - CheckMessageHasEnoughBytesToRead(&message, STRING_COLUMNMETADATA_LEN); + CheckMessageHasEnoughBytesToReadColMetadata(&message, STRING_COLUMNMETADATA_LEN); memcpy(&colmetadata[currentColumn].maxLen, &message->data[offset], sizeof(uint16)); offset += sizeof(uint16); @@ -280,7 +306,7 @@ GetBulkLoadRequest(StringInfo message) { uint16_t tableLen = 0; - CheckMessageHasEnoughBytesToRead(&message, sizeof(uint32_t)); + CheckMessageHasEnoughBytesToReadColMetadata(&message, sizeof(uint32_t)); memcpy(&colmetadata[currentColumn].maxLen, &message->data[offset], sizeof(uint32_t)); offset += sizeof(uint32_t); @@ -288,45 +314,45 @@ GetBulkLoadRequest(StringInfo message) if (colmetadata[currentColumn].columnTdsType == TDS_TYPE_TEXT || colmetadata[currentColumn].columnTdsType == TDS_TYPE_NTEXT) { - CheckMessageHasEnoughBytesToRead(&message, sizeof(uint32_t) + 1); + CheckMessageHasEnoughBytesToReadColMetadata(&message, sizeof(uint32_t) + 1); memcpy(&collation, &message->data[offset], sizeof(uint32_t)); offset += sizeof(uint32_t); colmetadata[currentColumn].sortId = message->data[offset++]; colmetadata[currentColumn].encoding = TdsGetEncoding(collation); } - CheckMessageHasEnoughBytesToRead(&message, sizeof(uint16_t)); + CheckMessageHasEnoughBytesToReadColMetadata(&message, sizeof(uint16_t)); memcpy(&tableLen, &message->data[offset], sizeof(uint16_t)); offset += sizeof(uint16_t); /* Skip table name for now. */ - CheckMessageHasEnoughBytesToRead(&message, tableLen * 2); + CheckMessageHasEnoughBytesToReadColMetadata(&message, tableLen * 2); offset += tableLen * 2; } break; case TDS_TYPE_XML: { - CheckMessageHasEnoughBytesToRead(&message, 1); + CheckMessageHasEnoughBytesToReadColMetadata(&message, 1); colmetadata[currentColumn].maxLen = message->data[offset++]; } break; case TDS_TYPE_DATETIME2: { - CheckMessageHasEnoughBytesToRead(&message, FIXED_LEN_TYPE_COLUMNMETADATA_LEN); + CheckMessageHasEnoughBytesToReadColMetadata(&message, FIXED_LEN_TYPE_COLUMNMETADATA_LEN); colmetadata[currentColumn].scale = message->data[offset++]; colmetadata[currentColumn].maxLen = 8; } break; case TDS_TYPE_TIME: { - CheckMessageHasEnoughBytesToRead(&message, FIXED_LEN_TYPE_COLUMNMETADATA_LEN); + CheckMessageHasEnoughBytesToReadColMetadata(&message, FIXED_LEN_TYPE_COLUMNMETADATA_LEN); colmetadata[currentColumn].scale = message->data[offset++]; colmetadata[currentColumn].maxLen = 5; } break; case TDS_TYPE_DATETIMEOFFSET: { - CheckMessageHasEnoughBytesToRead(&message, FIXED_LEN_TYPE_COLUMNMETADATA_LEN); + CheckMessageHasEnoughBytesToReadColMetadata(&message, FIXED_LEN_TYPE_COLUMNMETADATA_LEN); colmetadata[currentColumn].scale = message->data[offset++]; colmetadata[currentColumn].maxLen = 10; } @@ -336,7 +362,7 @@ GetBulkLoadRequest(StringInfo message) { uint16 plp; - CheckMessageHasEnoughBytesToRead(&message, BINARY_COLUMNMETADATA_LEN); + CheckMessageHasEnoughBytesToReadColMetadata(&message, BINARY_COLUMNMETADATA_LEN); memcpy(&plp, &message->data[offset], sizeof(uint16)); offset += sizeof(uint16); colmetadata[currentColumn].maxLen = plp; @@ -346,7 +372,7 @@ GetBulkLoadRequest(StringInfo message) colmetadata[currentColumn].maxLen = 3; break; case TDS_TYPE_SQLVARIANT: - CheckMessageHasEnoughBytesToRead(&message, SQL_VARIANT_COLUMNMETADATA_LEN); + CheckMessageHasEnoughBytesToReadColMetadata(&message, SQL_VARIANT_COLUMNMETADATA_LEN); memcpy(&colmetadata[currentColumn].maxLen, &message->data[offset], sizeof(uint32_t)); offset += sizeof(uint32_t); break; @@ -442,10 +468,10 @@ GetBulkLoadRequest(StringInfo message) } /* Column Name */ - CheckMessageHasEnoughBytesToRead(&message, sizeof(uint8_t)); + CheckMessageHasEnoughBytesToReadColMetadata(&message, sizeof(uint8_t)); memcpy(&colmetadata[currentColumn].colNameLen, &message->data[offset++], sizeof(uint8_t)); - CheckMessageHasEnoughBytesToRead(&message, colmetadata[currentColumn].colNameLen * 2); + CheckMessageHasEnoughBytesToReadColMetadata(&message, colmetadata[currentColumn].colNameLen * 2); colmetadata[currentColumn].colName = (char *) palloc0(colmetadata[currentColumn].colNameLen * sizeof(char) * 2 + 1); memcpy(colmetadata[currentColumn].colName, &message->data[offset], colmetadata[currentColumn].colNameLen * 2); @@ -475,7 +501,7 @@ SetBulkLoadRowData(TDSRequestBulkLoad request, StringInfo message) request->rowData = NIL; request->currentBatchSize = 0; - CheckMessageHasEnoughBytesToRead(&message, 1); + CheckMessageHasEnoughBytesToReadRows(&message, 1); /* Loop over each row. */ while ((uint8_t) message->data[offset] == TDS_TOKEN_ROW @@ -515,7 +541,7 @@ SetBulkLoadRowData(TDSRequestBulkLoad request, StringInfo message) } else { - CheckMessageHasEnoughBytesToRead(&message, 1); + CheckMessageHasEnoughBytesToReadRows(&message, 1); len = message->data[offset++]; request->currentBatchSize++; @@ -528,7 +554,7 @@ SetBulkLoadRowData(TDSRequestBulkLoad request, StringInfo message) } CheckForInvalidLength(len, request, i); - CheckMessageHasEnoughBytesToRead(&message, len); + CheckMessageHasEnoughBytesToReadRows(&message, len); /* Build temp Stringinfo. */ temp->data = &message->data[offset]; @@ -593,7 +619,7 @@ SetBulkLoadRowData(TDSRequestBulkLoad request, StringInfo message) "Check the source data for invalid values. An example of an invalid value is data of numeric type with scale greater than precision.", request->rowCount, i + 1))); - CheckMessageHasEnoughBytesToRead(&message, 1); + CheckMessageHasEnoughBytesToReadRows(&message, 1); len = message->data[offset++]; request->currentBatchSize++; @@ -606,7 +632,7 @@ SetBulkLoadRowData(TDSRequestBulkLoad request, StringInfo message) CheckForInvalidLength(len, request, i); - CheckMessageHasEnoughBytesToRead(&message, len); + CheckMessageHasEnoughBytesToReadRows(&message, len); /* Build temp Stringinfo. */ temp->data = &message->data[offset]; @@ -634,7 +660,7 @@ SetBulkLoadRowData(TDSRequestBulkLoad request, StringInfo message) { if (colmetadata[i].maxLen != 0xffff) { - CheckMessageHasEnoughBytesToRead(&message, sizeof(short)); + CheckMessageHasEnoughBytesToReadRows(&message, sizeof(short)); memcpy(&len, &message->data[offset], sizeof(short)); offset += sizeof(short); request->currentBatchSize += sizeof(short); @@ -642,7 +668,7 @@ SetBulkLoadRowData(TDSRequestBulkLoad request, StringInfo message) { CheckForInvalidLength(len, request, i); - CheckMessageHasEnoughBytesToRead(&message, len); + CheckMessageHasEnoughBytesToReadRows(&message, len); /* Build temp Stringinfo. */ temp->data = &message->data[offset]; @@ -716,7 +742,7 @@ SetBulkLoadRowData(TDSRequestBulkLoad request, StringInfo message) { uint8 dataTextPtrLen; - CheckMessageHasEnoughBytesToRead(&message, 1); + CheckMessageHasEnoughBytesToReadRows(&message, 1); /* * Ignore the Data Text Ptr since its currently of no @@ -731,7 +757,7 @@ SetBulkLoadRowData(TDSRequestBulkLoad request, StringInfo message) continue; } - CheckMessageHasEnoughBytesToRead(&message, dataTextPtrLen + 8 + sizeof(uint32_t)); + CheckMessageHasEnoughBytesToReadRows(&message, dataTextPtrLen + 8 + sizeof(uint32_t)); offset += dataTextPtrLen; request->currentBatchSize += dataTextPtrLen; @@ -751,7 +777,7 @@ SetBulkLoadRowData(TDSRequestBulkLoad request, StringInfo message) CheckForInvalidLength(len, request, i); - CheckMessageHasEnoughBytesToRead(&message, len); + CheckMessageHasEnoughBytesToReadRows(&message, len); /* Build temp Stringinfo. */ temp->data = &message->data[offset]; @@ -813,7 +839,7 @@ SetBulkLoadRowData(TDSRequestBulkLoad request, StringInfo message) break; case TDS_TYPE_SQLVARIANT: { - CheckMessageHasEnoughBytesToRead(&message, sizeof(uint32_t)); + CheckMessageHasEnoughBytesToReadRows(&message, sizeof(uint32_t)); memcpy(&len, &message->data[offset], sizeof(uint32_t)); offset += sizeof(uint32_t); @@ -828,7 +854,7 @@ SetBulkLoadRowData(TDSRequestBulkLoad request, StringInfo message) CheckForInvalidLength(len, request, i); - CheckMessageHasEnoughBytesToRead(&message, len); + CheckMessageHasEnoughBytesToReadRows(&message, len); /* Build temp Stringinfo. */ temp->data = &message->data[offset]; @@ -850,15 +876,14 @@ SetBulkLoadRowData(TDSRequestBulkLoad request, StringInfo message) i++; } request->rowData = lappend(request->rowData, rowData); - CheckMessageHasEnoughBytesToRead(&message, 1); + CheckMessageHasEnoughBytesToReadRows(&message, 1); } /* * If row count is less than the default batch size then this is the last * packet, the next byte should be the done token. */ - CheckMessageHasEnoughBytesToRead(&message, 1); - + CheckMessageHasEnoughBytesToReadRows(&message, 1); if (request->rowCount < pltsql_plugin_handler_ptr->get_insert_bulk_rows_per_batch() && request->currentBatchSize < pltsql_plugin_handler_ptr->get_insert_bulk_kilobytes_per_batch() * 1024 && (uint8_t) message->data[offset] != TDS_TOKEN_DONE) diff --git a/test/dotnet/ExpectedOutput/bcp-500-cols.out b/test/dotnet/ExpectedOutput/bcp-500-cols.out new file mode 100644 index 0000000000..1d9fa5aabf --- /dev/null +++ b/test/dotnet/ExpectedOutput/bcp-500-cols.out @@ -0,0 +1,13 @@ +#Q#Create table sourceTable1 (a1 int, a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8 int, a9 int, a10 int, a11 int, a12 int, a13 int, a14 int, a15 int, a16 int, a17 int, a18 int, a19 int, a20 int, a21 int, a22 int, a23 int, a24 int, a25 int, a26 int, a27 int, a28 int, a29 int, a30 int, a31 int, a32 int, a33 int, a34 int, a35 int, a36 int, a37 int, a38 int, a39 int, a40 int, a41 int, a42 int, a43 int, a44 int, a45 int, a46 int, a47 int, a48 int, a49 int, a50 int, a51 int, a52 int, a53 int, a54 int, a55 int, a56 int, a57 int, a58 int, a59 int, a60 int, a61 int, a62 int, a63 int, a64 int, a65 int, a66 int, a67 int, a68 int, a69 int, a70 int, a71 int, a72 int, a73 int, a74 int, a75 int, a76 int, a77 int, a78 int, a79 int, a80 int, a81 int, a82 int, a83 int, a84 int, a85 int, a86 int, a87 int, a88 int, a89 int, a90 int, a91 int, a92 int, a93 int, a94 int, a95 int, a96 int, a97 int, a98 int, a99 int, a100 int, a101 int, a102 int, a103 int, a104 int, a105 int, a106 int, a107 int, a108 int, a109 int, a110 int, a111 int, a112 int, a113 int, a114 int, a115 int, a116 int, a117 int, a118 int, a119 int, a120 int, a121 int, a122 int, a123 int, a124 int, a125 int, a126 int, a127 int, a128 int, a129 int, a130 int, a131 int, a132 int, a133 int, a134 int, a135 int, a136 int, a137 int, a138 int, a139 int, a140 int, a141 int, a142 int, a143 int, a144 int, a145 int, a146 int, a147 int, a148 int, a149 int, a150 int, a151 int, a152 int, a153 int, a154 int, a155 int, a156 int, a157 int, a158 int, a159 int, a160 int, a161 int, a162 int, a163 int, a164 int, a165 int, a166 int, a167 int, a168 int, a169 int, a170 int, a171 int, a172 int, a173 int, a174 int, a175 int, a176 int, a177 int, a178 int, a179 int, a180 int, a181 int, a182 int, a183 int, a184 int, a185 int, a186 int, a187 int, a188 int, a189 int, a190 int, a191 int, a192 int, a193 int, a194 int, a195 int, a196 int, a197 int, a198 int, a199 int, a200 int, a201 int, a202 int, a203 int, a204 int, a205 int, a206 int, a207 int, a208 int, a209 int, a210 int, a211 int, a212 int, a213 int, a214 int, a215 int, a216 int, a217 int, a218 int, a219 int, a220 int, a221 int, a222 int, a223 int, a224 int, a225 int, a226 int, a227 int, a228 int, a229 int, a230 int, a231 int, a232 int, a233 int, a234 int, a235 int, a236 int, a237 int, a238 int, a239 int, a240 int, a241 int, a242 int, a243 int, a244 int, a245 int, a246 int, a247 int, a248 int, a249 int, a250 int, a251 int, a252 int, a253 int, a254 int, a255 int, a256 int, a257 int, a258 int, a259 int, a260 int, a261 int, a262 int, a263 int, a264 int, a265 int, a266 int, a267 int, a268 int, a269 int, a270 int, a271 int, a272 int, a273 int, a274 int, a275 int, a276 int, a277 int, a278 int, a279 int, a280 int, a281 int, a282 int, a283 int, a284 int, a285 int, a286 int, a287 int, a288 int, a289 int, a290 int, a291 int, a292 int, a293 int, a294 int, a295 int, a296 int, a297 int, a298 int, a299 int, a300 int, a301 int, a302 int, a303 int, a304 int, a305 int, a306 int, a307 int, a308 int, a309 int, a310 int, a311 int, a312 int, a313 int, a314 int, a315 int, a316 int, a317 int, a318 int, a319 int, a320 int, a321 int, a322 int, a323 int, a324 int, a325 int, a326 int, a327 int, a328 int, a329 int, a330 int, a331 int, a332 int, a333 int, a334 int, a335 int, a336 int, a337 int, a338 int, a339 int, a340 int, a341 int, a342 int, a343 int, a344 int, a345 int, a346 int, a347 int, a348 int, a349 int, a350 int, a351 int, a352 int, a353 int, a354 int, a355 int, a356 int, a357 int, a358 int, a359 int, a360 int, a361 int, a362 int, a363 int, a364 int, a365 int, a366 int, a367 int, a368 int, a369 int, a370 int, a371 int, a372 int, a373 int, a374 int, a375 int, a376 int, a377 int, a378 int, a379 int, a380 int, a381 int, a382 int, a383 int, a384 int, a385 int, a386 int, a387 int, a388 int, a389 int, a390 int, a391 int, a392 int, a393 int, a394 int, a395 int, a396 int, a397 int, a398 int, a399 int, a400 int, a401 int, a402 int, a403 int, a404 int, a405 int, a406 int, a407 int, a408 int, a409 int, a410 int, a411 int, a412 int, a413 int, a414 int, a415 int, a416 int, a417 int, a418 int, a419 int, a420 int, a421 int, a422 int, a423 int, a424 int, a425 int, a426 int, a427 int, a428 int, a429 int, a430 int, a431 int, a432 int, a433 int, a434 int, a435 int, a436 int, a437 int, a438 int, a439 int, a440 int, a441 int, a442 int, a443 int, a444 int, a445 int, a446 int, a447 int, a448 int, a449 int, a450 int, a451 int, a452 int, a453 int, a454 int, a455 int, a456 int, a457 int, a458 int, a459 int, a460 int, a461 int, a462 int, a463 int, a464 int, a465 int, a466 int, a467 int, a468 int, a469 int, a470 int, a471 int, a472 int, a473 int, a474 int, a475 int, a476 int, a477 int, a478 int, a479 int, a480 int, a481 int, a482 int, a483 int, a484 int, a485 int, a486 int, a487 int, a488 int, a489 int, a490 int, a491 int, a492 int, a493 int, a494 int, a495 int, a496 int, a497 int, a498 int, a499 int, a500 int); +#Q#Create table destinationTable1 (a1 int, a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8 int, a9 int, a10 int, a11 int, a12 int, a13 int, a14 int, a15 int, a16 int, a17 int, a18 int, a19 int, a20 int, a21 int, a22 int, a23 int, a24 int, a25 int, a26 int, a27 int, a28 int, a29 int, a30 int, a31 int, a32 int, a33 int, a34 int, a35 int, a36 int, a37 int, a38 int, a39 int, a40 int, a41 int, a42 int, a43 int, a44 int, a45 int, a46 int, a47 int, a48 int, a49 int, a50 int, a51 int, a52 int, a53 int, a54 int, a55 int, a56 int, a57 int, a58 int, a59 int, a60 int, a61 int, a62 int, a63 int, a64 int, a65 int, a66 int, a67 int, a68 int, a69 int, a70 int, a71 int, a72 int, a73 int, a74 int, a75 int, a76 int, a77 int, a78 int, a79 int, a80 int, a81 int, a82 int, a83 int, a84 int, a85 int, a86 int, a87 int, a88 int, a89 int, a90 int, a91 int, a92 int, a93 int, a94 int, a95 int, a96 int, a97 int, a98 int, a99 int, a100 int, a101 int, a102 int, a103 int, a104 int, a105 int, a106 int, a107 int, a108 int, a109 int, a110 int, a111 int, a112 int, a113 int, a114 int, a115 int, a116 int, a117 int, a118 int, a119 int, a120 int, a121 int, a122 int, a123 int, a124 int, a125 int, a126 int, a127 int, a128 int, a129 int, a130 int, a131 int, a132 int, a133 int, a134 int, a135 int, a136 int, a137 int, a138 int, a139 int, a140 int, a141 int, a142 int, a143 int, a144 int, a145 int, a146 int, a147 int, a148 int, a149 int, a150 int, a151 int, a152 int, a153 int, a154 int, a155 int, a156 int, a157 int, a158 int, a159 int, a160 int, a161 int, a162 int, a163 int, a164 int, a165 int, a166 int, a167 int, a168 int, a169 int, a170 int, a171 int, a172 int, a173 int, a174 int, a175 int, a176 int, a177 int, a178 int, a179 int, a180 int, a181 int, a182 int, a183 int, a184 int, a185 int, a186 int, a187 int, a188 int, a189 int, a190 int, a191 int, a192 int, a193 int, a194 int, a195 int, a196 int, a197 int, a198 int, a199 int, a200 int, a201 int, a202 int, a203 int, a204 int, a205 int, a206 int, a207 int, a208 int, a209 int, a210 int, a211 int, a212 int, a213 int, a214 int, a215 int, a216 int, a217 int, a218 int, a219 int, a220 int, a221 int, a222 int, a223 int, a224 int, a225 int, a226 int, a227 int, a228 int, a229 int, a230 int, a231 int, a232 int, a233 int, a234 int, a235 int, a236 int, a237 int, a238 int, a239 int, a240 int, a241 int, a242 int, a243 int, a244 int, a245 int, a246 int, a247 int, a248 int, a249 int, a250 int, a251 int, a252 int, a253 int, a254 int, a255 int, a256 int, a257 int, a258 int, a259 int, a260 int, a261 int, a262 int, a263 int, a264 int, a265 int, a266 int, a267 int, a268 int, a269 int, a270 int, a271 int, a272 int, a273 int, a274 int, a275 int, a276 int, a277 int, a278 int, a279 int, a280 int, a281 int, a282 int, a283 int, a284 int, a285 int, a286 int, a287 int, a288 int, a289 int, a290 int, a291 int, a292 int, a293 int, a294 int, a295 int, a296 int, a297 int, a298 int, a299 int, a300 int, a301 int, a302 int, a303 int, a304 int, a305 int, a306 int, a307 int, a308 int, a309 int, a310 int, a311 int, a312 int, a313 int, a314 int, a315 int, a316 int, a317 int, a318 int, a319 int, a320 int, a321 int, a322 int, a323 int, a324 int, a325 int, a326 int, a327 int, a328 int, a329 int, a330 int, a331 int, a332 int, a333 int, a334 int, a335 int, a336 int, a337 int, a338 int, a339 int, a340 int, a341 int, a342 int, a343 int, a344 int, a345 int, a346 int, a347 int, a348 int, a349 int, a350 int, a351 int, a352 int, a353 int, a354 int, a355 int, a356 int, a357 int, a358 int, a359 int, a360 int, a361 int, a362 int, a363 int, a364 int, a365 int, a366 int, a367 int, a368 int, a369 int, a370 int, a371 int, a372 int, a373 int, a374 int, a375 int, a376 int, a377 int, a378 int, a379 int, a380 int, a381 int, a382 int, a383 int, a384 int, a385 int, a386 int, a387 int, a388 int, a389 int, a390 int, a391 int, a392 int, a393 int, a394 int, a395 int, a396 int, a397 int, a398 int, a399 int, a400 int, a401 int, a402 int, a403 int, a404 int, a405 int, a406 int, a407 int, a408 int, a409 int, a410 int, a411 int, a412 int, a413 int, a414 int, a415 int, a416 int, a417 int, a418 int, a419 int, a420 int, a421 int, a422 int, a423 int, a424 int, a425 int, a426 int, a427 int, a428 int, a429 int, a430 int, a431 int, a432 int, a433 int, a434 int, a435 int, a436 int, a437 int, a438 int, a439 int, a440 int, a441 int, a442 int, a443 int, a444 int, a445 int, a446 int, a447 int, a448 int, a449 int, a450 int, a451 int, a452 int, a453 int, a454 int, a455 int, a456 int, a457 int, a458 int, a459 int, a460 int, a461 int, a462 int, a463 int, a464 int, a465 int, a466 int, a467 int, a468 int, a469 int, a470 int, a471 int, a472 int, a473 int, a474 int, a475 int, a476 int, a477 int, a478 int, a479 int, a480 int, a481 int, a482 int, a483 int, a484 int, a485 int, a486 int, a487 int, a488 int, a489 int, a490 int, a491 int, a492 int, a493 int, a494 int, a495 int, a496 int, a497 int, a498 int, a499 int, a500 int); +#Q#Insert into sourceTable1 values (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500); +bcp#!#out#!#bcp_source#!#sourceTable1 +bcp#!#in#!#bcp_source#!#destinationTable1 +#Q#Select * from sourceTable1 +#D#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int +1#!#2#!#3#!#4#!#5#!#6#!#7#!#8#!#9#!#10#!#11#!#12#!#13#!#14#!#15#!#16#!#17#!#18#!#19#!#20#!#21#!#22#!#23#!#24#!#25#!#26#!#27#!#28#!#29#!#30#!#31#!#32#!#33#!#34#!#35#!#36#!#37#!#38#!#39#!#40#!#41#!#42#!#43#!#44#!#45#!#46#!#47#!#48#!#49#!#50#!#51#!#52#!#53#!#54#!#55#!#56#!#57#!#58#!#59#!#60#!#61#!#62#!#63#!#64#!#65#!#66#!#67#!#68#!#69#!#70#!#71#!#72#!#73#!#74#!#75#!#76#!#77#!#78#!#79#!#80#!#81#!#82#!#83#!#84#!#85#!#86#!#87#!#88#!#89#!#90#!#91#!#92#!#93#!#94#!#95#!#96#!#97#!#98#!#99#!#100#!#101#!#102#!#103#!#104#!#105#!#106#!#107#!#108#!#109#!#110#!#111#!#112#!#113#!#114#!#115#!#116#!#117#!#118#!#119#!#120#!#121#!#122#!#123#!#124#!#125#!#126#!#127#!#128#!#129#!#130#!#131#!#132#!#133#!#134#!#135#!#136#!#137#!#138#!#139#!#140#!#141#!#142#!#143#!#144#!#145#!#146#!#147#!#148#!#149#!#150#!#151#!#152#!#153#!#154#!#155#!#156#!#157#!#158#!#159#!#160#!#161#!#162#!#163#!#164#!#165#!#166#!#167#!#168#!#169#!#170#!#171#!#172#!#173#!#174#!#175#!#176#!#177#!#178#!#179#!#180#!#181#!#182#!#183#!#184#!#185#!#186#!#187#!#188#!#189#!#190#!#191#!#192#!#193#!#194#!#195#!#196#!#197#!#198#!#199#!#200#!#201#!#202#!#203#!#204#!#205#!#206#!#207#!#208#!#209#!#210#!#211#!#212#!#213#!#214#!#215#!#216#!#217#!#218#!#219#!#220#!#221#!#222#!#223#!#224#!#225#!#226#!#227#!#228#!#229#!#230#!#231#!#232#!#233#!#234#!#235#!#236#!#237#!#238#!#239#!#240#!#241#!#242#!#243#!#244#!#245#!#246#!#247#!#248#!#249#!#250#!#251#!#252#!#253#!#254#!#255#!#256#!#257#!#258#!#259#!#260#!#261#!#262#!#263#!#264#!#265#!#266#!#267#!#268#!#269#!#270#!#271#!#272#!#273#!#274#!#275#!#276#!#277#!#278#!#279#!#280#!#281#!#282#!#283#!#284#!#285#!#286#!#287#!#288#!#289#!#290#!#291#!#292#!#293#!#294#!#295#!#296#!#297#!#298#!#299#!#300#!#301#!#302#!#303#!#304#!#305#!#306#!#307#!#308#!#309#!#310#!#311#!#312#!#313#!#314#!#315#!#316#!#317#!#318#!#319#!#320#!#321#!#322#!#323#!#324#!#325#!#326#!#327#!#328#!#329#!#330#!#331#!#332#!#333#!#334#!#335#!#336#!#337#!#338#!#339#!#340#!#341#!#342#!#343#!#344#!#345#!#346#!#347#!#348#!#349#!#350#!#351#!#352#!#353#!#354#!#355#!#356#!#357#!#358#!#359#!#360#!#361#!#362#!#363#!#364#!#365#!#366#!#367#!#368#!#369#!#370#!#371#!#372#!#373#!#374#!#375#!#376#!#377#!#378#!#379#!#380#!#381#!#382#!#383#!#384#!#385#!#386#!#387#!#388#!#389#!#390#!#391#!#392#!#393#!#394#!#395#!#396#!#397#!#398#!#399#!#400#!#401#!#402#!#403#!#404#!#405#!#406#!#407#!#408#!#409#!#410#!#411#!#412#!#413#!#414#!#415#!#416#!#417#!#418#!#419#!#420#!#421#!#422#!#423#!#424#!#425#!#426#!#427#!#428#!#429#!#430#!#431#!#432#!#433#!#434#!#435#!#436#!#437#!#438#!#439#!#440#!#441#!#442#!#443#!#444#!#445#!#446#!#447#!#448#!#449#!#450#!#451#!#452#!#453#!#454#!#455#!#456#!#457#!#458#!#459#!#460#!#461#!#462#!#463#!#464#!#465#!#466#!#467#!#468#!#469#!#470#!#471#!#472#!#473#!#474#!#475#!#476#!#477#!#478#!#479#!#480#!#481#!#482#!#483#!#484#!#485#!#486#!#487#!#488#!#489#!#490#!#491#!#492#!#493#!#494#!#495#!#496#!#497#!#498#!#499#!#500 +#Q#Select * from destinationTable1 +#D#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int +1#!#2#!#3#!#4#!#5#!#6#!#7#!#8#!#9#!#10#!#11#!#12#!#13#!#14#!#15#!#16#!#17#!#18#!#19#!#20#!#21#!#22#!#23#!#24#!#25#!#26#!#27#!#28#!#29#!#30#!#31#!#32#!#33#!#34#!#35#!#36#!#37#!#38#!#39#!#40#!#41#!#42#!#43#!#44#!#45#!#46#!#47#!#48#!#49#!#50#!#51#!#52#!#53#!#54#!#55#!#56#!#57#!#58#!#59#!#60#!#61#!#62#!#63#!#64#!#65#!#66#!#67#!#68#!#69#!#70#!#71#!#72#!#73#!#74#!#75#!#76#!#77#!#78#!#79#!#80#!#81#!#82#!#83#!#84#!#85#!#86#!#87#!#88#!#89#!#90#!#91#!#92#!#93#!#94#!#95#!#96#!#97#!#98#!#99#!#100#!#101#!#102#!#103#!#104#!#105#!#106#!#107#!#108#!#109#!#110#!#111#!#112#!#113#!#114#!#115#!#116#!#117#!#118#!#119#!#120#!#121#!#122#!#123#!#124#!#125#!#126#!#127#!#128#!#129#!#130#!#131#!#132#!#133#!#134#!#135#!#136#!#137#!#138#!#139#!#140#!#141#!#142#!#143#!#144#!#145#!#146#!#147#!#148#!#149#!#150#!#151#!#152#!#153#!#154#!#155#!#156#!#157#!#158#!#159#!#160#!#161#!#162#!#163#!#164#!#165#!#166#!#167#!#168#!#169#!#170#!#171#!#172#!#173#!#174#!#175#!#176#!#177#!#178#!#179#!#180#!#181#!#182#!#183#!#184#!#185#!#186#!#187#!#188#!#189#!#190#!#191#!#192#!#193#!#194#!#195#!#196#!#197#!#198#!#199#!#200#!#201#!#202#!#203#!#204#!#205#!#206#!#207#!#208#!#209#!#210#!#211#!#212#!#213#!#214#!#215#!#216#!#217#!#218#!#219#!#220#!#221#!#222#!#223#!#224#!#225#!#226#!#227#!#228#!#229#!#230#!#231#!#232#!#233#!#234#!#235#!#236#!#237#!#238#!#239#!#240#!#241#!#242#!#243#!#244#!#245#!#246#!#247#!#248#!#249#!#250#!#251#!#252#!#253#!#254#!#255#!#256#!#257#!#258#!#259#!#260#!#261#!#262#!#263#!#264#!#265#!#266#!#267#!#268#!#269#!#270#!#271#!#272#!#273#!#274#!#275#!#276#!#277#!#278#!#279#!#280#!#281#!#282#!#283#!#284#!#285#!#286#!#287#!#288#!#289#!#290#!#291#!#292#!#293#!#294#!#295#!#296#!#297#!#298#!#299#!#300#!#301#!#302#!#303#!#304#!#305#!#306#!#307#!#308#!#309#!#310#!#311#!#312#!#313#!#314#!#315#!#316#!#317#!#318#!#319#!#320#!#321#!#322#!#323#!#324#!#325#!#326#!#327#!#328#!#329#!#330#!#331#!#332#!#333#!#334#!#335#!#336#!#337#!#338#!#339#!#340#!#341#!#342#!#343#!#344#!#345#!#346#!#347#!#348#!#349#!#350#!#351#!#352#!#353#!#354#!#355#!#356#!#357#!#358#!#359#!#360#!#361#!#362#!#363#!#364#!#365#!#366#!#367#!#368#!#369#!#370#!#371#!#372#!#373#!#374#!#375#!#376#!#377#!#378#!#379#!#380#!#381#!#382#!#383#!#384#!#385#!#386#!#387#!#388#!#389#!#390#!#391#!#392#!#393#!#394#!#395#!#396#!#397#!#398#!#399#!#400#!#401#!#402#!#403#!#404#!#405#!#406#!#407#!#408#!#409#!#410#!#411#!#412#!#413#!#414#!#415#!#416#!#417#!#418#!#419#!#420#!#421#!#422#!#423#!#424#!#425#!#426#!#427#!#428#!#429#!#430#!#431#!#432#!#433#!#434#!#435#!#436#!#437#!#438#!#439#!#440#!#441#!#442#!#443#!#444#!#445#!#446#!#447#!#448#!#449#!#450#!#451#!#452#!#453#!#454#!#455#!#456#!#457#!#458#!#459#!#460#!#461#!#462#!#463#!#464#!#465#!#466#!#467#!#468#!#469#!#470#!#471#!#472#!#473#!#474#!#475#!#476#!#477#!#478#!#479#!#480#!#481#!#482#!#483#!#484#!#485#!#486#!#487#!#488#!#489#!#490#!#491#!#492#!#493#!#494#!#495#!#496#!#497#!#498#!#499#!#500 +#Q#drop table sourceTable1 +#Q#drop table destinationTable1 diff --git a/test/dotnet/input/InsertBulk/bcp-500-cols.txt b/test/dotnet/input/InsertBulk/bcp-500-cols.txt new file mode 100644 index 0000000000..7400c14bae --- /dev/null +++ b/test/dotnet/input/InsertBulk/bcp-500-cols.txt @@ -0,0 +1,13 @@ +Create table sourceTable1 (a1 int, a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8 int, a9 int, a10 int, a11 int, a12 int, a13 int, a14 int, a15 int, a16 int, a17 int, a18 int, a19 int, a20 int, a21 int, a22 int, a23 int, a24 int, a25 int, a26 int, a27 int, a28 int, a29 int, a30 int, a31 int, a32 int, a33 int, a34 int, a35 int, a36 int, a37 int, a38 int, a39 int, a40 int, a41 int, a42 int, a43 int, a44 int, a45 int, a46 int, a47 int, a48 int, a49 int, a50 int, a51 int, a52 int, a53 int, a54 int, a55 int, a56 int, a57 int, a58 int, a59 int, a60 int, a61 int, a62 int, a63 int, a64 int, a65 int, a66 int, a67 int, a68 int, a69 int, a70 int, a71 int, a72 int, a73 int, a74 int, a75 int, a76 int, a77 int, a78 int, a79 int, a80 int, a81 int, a82 int, a83 int, a84 int, a85 int, a86 int, a87 int, a88 int, a89 int, a90 int, a91 int, a92 int, a93 int, a94 int, a95 int, a96 int, a97 int, a98 int, a99 int, a100 int, a101 int, a102 int, a103 int, a104 int, a105 int, a106 int, a107 int, a108 int, a109 int, a110 int, a111 int, a112 int, a113 int, a114 int, a115 int, a116 int, a117 int, a118 int, a119 int, a120 int, a121 int, a122 int, a123 int, a124 int, a125 int, a126 int, a127 int, a128 int, a129 int, a130 int, a131 int, a132 int, a133 int, a134 int, a135 int, a136 int, a137 int, a138 int, a139 int, a140 int, a141 int, a142 int, a143 int, a144 int, a145 int, a146 int, a147 int, a148 int, a149 int, a150 int, a151 int, a152 int, a153 int, a154 int, a155 int, a156 int, a157 int, a158 int, a159 int, a160 int, a161 int, a162 int, a163 int, a164 int, a165 int, a166 int, a167 int, a168 int, a169 int, a170 int, a171 int, a172 int, a173 int, a174 int, a175 int, a176 int, a177 int, a178 int, a179 int, a180 int, a181 int, a182 int, a183 int, a184 int, a185 int, a186 int, a187 int, a188 int, a189 int, a190 int, a191 int, a192 int, a193 int, a194 int, a195 int, a196 int, a197 int, a198 int, a199 int, a200 int, a201 int, a202 int, a203 int, a204 int, a205 int, a206 int, a207 int, a208 int, a209 int, a210 int, a211 int, a212 int, a213 int, a214 int, a215 int, a216 int, a217 int, a218 int, a219 int, a220 int, a221 int, a222 int, a223 int, a224 int, a225 int, a226 int, a227 int, a228 int, a229 int, a230 int, a231 int, a232 int, a233 int, a234 int, a235 int, a236 int, a237 int, a238 int, a239 int, a240 int, a241 int, a242 int, a243 int, a244 int, a245 int, a246 int, a247 int, a248 int, a249 int, a250 int, a251 int, a252 int, a253 int, a254 int, a255 int, a256 int, a257 int, a258 int, a259 int, a260 int, a261 int, a262 int, a263 int, a264 int, a265 int, a266 int, a267 int, a268 int, a269 int, a270 int, a271 int, a272 int, a273 int, a274 int, a275 int, a276 int, a277 int, a278 int, a279 int, a280 int, a281 int, a282 int, a283 int, a284 int, a285 int, a286 int, a287 int, a288 int, a289 int, a290 int, a291 int, a292 int, a293 int, a294 int, a295 int, a296 int, a297 int, a298 int, a299 int, a300 int, a301 int, a302 int, a303 int, a304 int, a305 int, a306 int, a307 int, a308 int, a309 int, a310 int, a311 int, a312 int, a313 int, a314 int, a315 int, a316 int, a317 int, a318 int, a319 int, a320 int, a321 int, a322 int, a323 int, a324 int, a325 int, a326 int, a327 int, a328 int, a329 int, a330 int, a331 int, a332 int, a333 int, a334 int, a335 int, a336 int, a337 int, a338 int, a339 int, a340 int, a341 int, a342 int, a343 int, a344 int, a345 int, a346 int, a347 int, a348 int, a349 int, a350 int, a351 int, a352 int, a353 int, a354 int, a355 int, a356 int, a357 int, a358 int, a359 int, a360 int, a361 int, a362 int, a363 int, a364 int, a365 int, a366 int, a367 int, a368 int, a369 int, a370 int, a371 int, a372 int, a373 int, a374 int, a375 int, a376 int, a377 int, a378 int, a379 int, a380 int, a381 int, a382 int, a383 int, a384 int, a385 int, a386 int, a387 int, a388 int, a389 int, a390 int, a391 int, a392 int, a393 int, a394 int, a395 int, a396 int, a397 int, a398 int, a399 int, a400 int, a401 int, a402 int, a403 int, a404 int, a405 int, a406 int, a407 int, a408 int, a409 int, a410 int, a411 int, a412 int, a413 int, a414 int, a415 int, a416 int, a417 int, a418 int, a419 int, a420 int, a421 int, a422 int, a423 int, a424 int, a425 int, a426 int, a427 int, a428 int, a429 int, a430 int, a431 int, a432 int, a433 int, a434 int, a435 int, a436 int, a437 int, a438 int, a439 int, a440 int, a441 int, a442 int, a443 int, a444 int, a445 int, a446 int, a447 int, a448 int, a449 int, a450 int, a451 int, a452 int, a453 int, a454 int, a455 int, a456 int, a457 int, a458 int, a459 int, a460 int, a461 int, a462 int, a463 int, a464 int, a465 int, a466 int, a467 int, a468 int, a469 int, a470 int, a471 int, a472 int, a473 int, a474 int, a475 int, a476 int, a477 int, a478 int, a479 int, a480 int, a481 int, a482 int, a483 int, a484 int, a485 int, a486 int, a487 int, a488 int, a489 int, a490 int, a491 int, a492 int, a493 int, a494 int, a495 int, a496 int, a497 int, a498 int, a499 int, a500 int); + +Create table destinationTable1 (a1 int, a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8 int, a9 int, a10 int, a11 int, a12 int, a13 int, a14 int, a15 int, a16 int, a17 int, a18 int, a19 int, a20 int, a21 int, a22 int, a23 int, a24 int, a25 int, a26 int, a27 int, a28 int, a29 int, a30 int, a31 int, a32 int, a33 int, a34 int, a35 int, a36 int, a37 int, a38 int, a39 int, a40 int, a41 int, a42 int, a43 int, a44 int, a45 int, a46 int, a47 int, a48 int, a49 int, a50 int, a51 int, a52 int, a53 int, a54 int, a55 int, a56 int, a57 int, a58 int, a59 int, a60 int, a61 int, a62 int, a63 int, a64 int, a65 int, a66 int, a67 int, a68 int, a69 int, a70 int, a71 int, a72 int, a73 int, a74 int, a75 int, a76 int, a77 int, a78 int, a79 int, a80 int, a81 int, a82 int, a83 int, a84 int, a85 int, a86 int, a87 int, a88 int, a89 int, a90 int, a91 int, a92 int, a93 int, a94 int, a95 int, a96 int, a97 int, a98 int, a99 int, a100 int, a101 int, a102 int, a103 int, a104 int, a105 int, a106 int, a107 int, a108 int, a109 int, a110 int, a111 int, a112 int, a113 int, a114 int, a115 int, a116 int, a117 int, a118 int, a119 int, a120 int, a121 int, a122 int, a123 int, a124 int, a125 int, a126 int, a127 int, a128 int, a129 int, a130 int, a131 int, a132 int, a133 int, a134 int, a135 int, a136 int, a137 int, a138 int, a139 int, a140 int, a141 int, a142 int, a143 int, a144 int, a145 int, a146 int, a147 int, a148 int, a149 int, a150 int, a151 int, a152 int, a153 int, a154 int, a155 int, a156 int, a157 int, a158 int, a159 int, a160 int, a161 int, a162 int, a163 int, a164 int, a165 int, a166 int, a167 int, a168 int, a169 int, a170 int, a171 int, a172 int, a173 int, a174 int, a175 int, a176 int, a177 int, a178 int, a179 int, a180 int, a181 int, a182 int, a183 int, a184 int, a185 int, a186 int, a187 int, a188 int, a189 int, a190 int, a191 int, a192 int, a193 int, a194 int, a195 int, a196 int, a197 int, a198 int, a199 int, a200 int, a201 int, a202 int, a203 int, a204 int, a205 int, a206 int, a207 int, a208 int, a209 int, a210 int, a211 int, a212 int, a213 int, a214 int, a215 int, a216 int, a217 int, a218 int, a219 int, a220 int, a221 int, a222 int, a223 int, a224 int, a225 int, a226 int, a227 int, a228 int, a229 int, a230 int, a231 int, a232 int, a233 int, a234 int, a235 int, a236 int, a237 int, a238 int, a239 int, a240 int, a241 int, a242 int, a243 int, a244 int, a245 int, a246 int, a247 int, a248 int, a249 int, a250 int, a251 int, a252 int, a253 int, a254 int, a255 int, a256 int, a257 int, a258 int, a259 int, a260 int, a261 int, a262 int, a263 int, a264 int, a265 int, a266 int, a267 int, a268 int, a269 int, a270 int, a271 int, a272 int, a273 int, a274 int, a275 int, a276 int, a277 int, a278 int, a279 int, a280 int, a281 int, a282 int, a283 int, a284 int, a285 int, a286 int, a287 int, a288 int, a289 int, a290 int, a291 int, a292 int, a293 int, a294 int, a295 int, a296 int, a297 int, a298 int, a299 int, a300 int, a301 int, a302 int, a303 int, a304 int, a305 int, a306 int, a307 int, a308 int, a309 int, a310 int, a311 int, a312 int, a313 int, a314 int, a315 int, a316 int, a317 int, a318 int, a319 int, a320 int, a321 int, a322 int, a323 int, a324 int, a325 int, a326 int, a327 int, a328 int, a329 int, a330 int, a331 int, a332 int, a333 int, a334 int, a335 int, a336 int, a337 int, a338 int, a339 int, a340 int, a341 int, a342 int, a343 int, a344 int, a345 int, a346 int, a347 int, a348 int, a349 int, a350 int, a351 int, a352 int, a353 int, a354 int, a355 int, a356 int, a357 int, a358 int, a359 int, a360 int, a361 int, a362 int, a363 int, a364 int, a365 int, a366 int, a367 int, a368 int, a369 int, a370 int, a371 int, a372 int, a373 int, a374 int, a375 int, a376 int, a377 int, a378 int, a379 int, a380 int, a381 int, a382 int, a383 int, a384 int, a385 int, a386 int, a387 int, a388 int, a389 int, a390 int, a391 int, a392 int, a393 int, a394 int, a395 int, a396 int, a397 int, a398 int, a399 int, a400 int, a401 int, a402 int, a403 int, a404 int, a405 int, a406 int, a407 int, a408 int, a409 int, a410 int, a411 int, a412 int, a413 int, a414 int, a415 int, a416 int, a417 int, a418 int, a419 int, a420 int, a421 int, a422 int, a423 int, a424 int, a425 int, a426 int, a427 int, a428 int, a429 int, a430 int, a431 int, a432 int, a433 int, a434 int, a435 int, a436 int, a437 int, a438 int, a439 int, a440 int, a441 int, a442 int, a443 int, a444 int, a445 int, a446 int, a447 int, a448 int, a449 int, a450 int, a451 int, a452 int, a453 int, a454 int, a455 int, a456 int, a457 int, a458 int, a459 int, a460 int, a461 int, a462 int, a463 int, a464 int, a465 int, a466 int, a467 int, a468 int, a469 int, a470 int, a471 int, a472 int, a473 int, a474 int, a475 int, a476 int, a477 int, a478 int, a479 int, a480 int, a481 int, a482 int, a483 int, a484 int, a485 int, a486 int, a487 int, a488 int, a489 int, a490 int, a491 int, a492 int, a493 int, a494 int, a495 int, a496 int, a497 int, a498 int, a499 int, a500 int); + +Insert into sourceTable1 values (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500); + +bcp#!#out#!#bcp_source#!#sourceTable1 +bcp#!#in#!#bcp_source#!#destinationTable1 +Select * from sourceTable1 +Select * from destinationTable1 + +drop table sourceTable1 +drop table destinationTable1