Schaeffrcc
Technical User
I am trying to Automate the moving of data from on Database to another with differnt size Fields. I am fine with the data being truncated down from 50 to 30 Char but do not know how to do it.
I get the following error:
Server: Msg 8152, Level 16, State 9, Line 60
String or binary data would be truncated.
The statement has been terminated.
My Query is as follows:
INSERT INTO clients
SELECT case_table.client_seq,
client.client_first_name,
client.client_middle_name,
client.client_last_name,
client_address.client_addr_1,
client_address.client_addr_2,
client_address.client_city,
client_address.client_state,
client_address.client_zip,
client.client_ssn,
client.client_number,
client_phone.client_phone_no,
client.client_dob
FROM (((#CaseHistSeq LEFT JOIN case_table ON
#CaseHistSeq.case_seq = case_table.case_seq) LEFT JOIN client ON
case_table.client_seq = client.client_seq) LEFT JOIN client_address ON
client.client_seq = client_address.client_seq) LEFT JOIN client_phone ON
client_address.client_addr_seq = client_phone.client_phone_seq
WHERE (((client_address.client_addr_primary)="Y"
)
ORDER BY case_table.client_seq;
Field such as Client_First_Name is 50 in original Table and 30 in destination table.
I have looked at BOL and only find a Function to Truncate Tables not individual Fields.
Thanks for any help,
Thomas.
I get the following error:
Server: Msg 8152, Level 16, State 9, Line 60
String or binary data would be truncated.
The statement has been terminated.
My Query is as follows:
INSERT INTO clients
SELECT case_table.client_seq,
client.client_first_name,
client.client_middle_name,
client.client_last_name,
client_address.client_addr_1,
client_address.client_addr_2,
client_address.client_city,
client_address.client_state,
client_address.client_zip,
client.client_ssn,
client.client_number,
client_phone.client_phone_no,
client.client_dob
FROM (((#CaseHistSeq LEFT JOIN case_table ON
#CaseHistSeq.case_seq = case_table.case_seq) LEFT JOIN client ON
case_table.client_seq = client.client_seq) LEFT JOIN client_address ON
client.client_seq = client_address.client_seq) LEFT JOIN client_phone ON
client_address.client_addr_seq = client_phone.client_phone_seq
WHERE (((client_address.client_addr_primary)="Y"
ORDER BY case_table.client_seq;
Field such as Client_First_Name is 50 in original Table and 30 in destination table.
I have looked at BOL and only find a Function to Truncate Tables not individual Fields.
Thanks for any help,
Thomas.