I am trying to copy data from one database table (backup) to a similar table on the product database. Request:
INSERT INTO candidates SELECT * FROM [estaffdb-20171101192519].dbo.candidates where creation_date < '2017-01-01' Error: Message 527, level 16, state 2, line 1 Implicit conversion between XML types constrained by different XML schema collections is not allowed. Use the CONVERT function to run this query.
The link to the table structure https://docs.google.com/spreadsheets/d/1EOyQcj7XPie6ZOokoYcQUit-NESExaJ-AhRPhD7fdHU/edit?usp=sharing
I understand correctly that all XML-type fields need to be wrapped in a CONVERT (XML, field_name) ?? Or are there other options?
PS How dangerous is it to run such a query? data almost a million.
INSERT INTO dbo.candidates SELECT *, CONVERT( XML, idata_division_id ), CONVERT( XML, roles ), CONVERT( XML, participant_events), CONVERT( XML, participant_event_group_id), CONVERT( XML, prev_educations), CONVERT( XML, passport), CONVERT( XML, external_registrations), CONVERT( XML, doc_info), CONVERT( XML, skills), CONVERT( XML, idata_citizenship_id), CONVERT( XML, idata_location_id), CONVERT( XML, metro_station_id), CONVERT( XML, idata_source_id), CONVERT( XML, profession_id), CONVERT( XML, idata_profession_id), CONVERT( XML, prev_jobs), CONVERT( XML, spots), CONVERT( XML, attachments), CONVERT( XML, hot_events), CONVERT( XML, multi_role_id), CONVERT( XML, external_uids), CONVERT( XML, desired_division_id), CONVERT( XML, job_target), CONVERT( XML, idata_group_id), CONVERT( XML, multi_attachment_type_id), CONVERT( XML, exclusive_access) FROM [estaffdb-20171101192519].dbo.candidates WHERE creation_date < '2017-01-01'