I am trying to do a bulk insert into a SQL table and I keep getting the error Bulk load data conversion error (truncation) for row when I run the stored procedure. I have included a row and field terminator. Any ideas what could be wrong here? TY
The source file has tabs between each field.
ALTER PROCEDURE [dbo].[sp_app_Import]
AS
DECLARE @SQL varchar(2000)
/*Truncate temporary table*/
TRUNCATE TABLE tbltableTemp
BULK INSERT tbltableTemp
FROM '\\server\public\Source_Files\test.txt'
WITH (FIELDTERMINATOR='\t', ROWTERMINATOR = '\r', FIRSTROW = 2)
/*Truncate permanent table*/
TRUNCATE TABLE tbl_test
INSERT INTO tbl_test
(MemberID,FacilityName,FacilityAddress1,FacilityAddress2,FacilityCity,FacilityState,FacilityZip,HIN,GLN,LIC,GPO)
SELECT '' AS MembershipID,RawData6 as FacilityName, RawData7 as FacilityAddress1,RawData8 as FacilityAddress2,RawData9 as FacilityCity, RawData10 as FacilityState,
RawData11 as FacilityZip, RawData26 as HIN, RawData2 as GLN, RawData1 as LIC, 'test' as GPO
FROM tbltableTemp