Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

String or binary data would be truncated Error?

Status
Not open for further replies.

nomi2000

ISP
Feb 15, 2001
676
CA
In this portion of SP when i m running from SP i am getting
the above error but if i run the query from outside it runs perfect
Any Idea whats wrong?
Regards
Nouman

Declare @MySQL varchar(4000)
if UPPER(@DocType)='7501ABIENT'
begin

if @ImporterID=''
SELECT @MySQL='SELECT
0,
[CEC_ID],
[CEC_SH_ID],
[CEC_EntryNo],
[CEC_ChkDgt],
[CEC_FileNo],
[CEC_Process],
[CEC_TypeCode],
[SCDC_Desc],
[Status],
[SCC_PortEntry_ID],
[CEC_SecNo]
FROM
[dbo].[v_CustomsEntry_Select]
WHERE ltrim(rtrim([CEC_Process])) =''7501''
AND SCDC_Code=''Y'''
else
SELECT @MySQL='SELECT
0,
[CEC_ID],
[CEC_SH_ID],
[CEC_EntryNo],
[CEC_ChkDgt],
[CEC_FileNo],
[CEC_Process],
[CEC_TypeCode],
[SCDC_Desc],
[Status],
[SCC_PortEntry_ID],
[CEC_SecNo]
FROM
[dbo].[v_CustomsEntry_Select]
WHERE ltrim(rtrim([CEC_Process])) =''7501''
AND SCDC_Code=''Y''
AND SHC_Importer_ID='''+ @ImporterID +''''
--print @MySQL

INSERT INTO [dbo].[#TEMP_ABI_PROCESS]
exec (@MySql)

SELECT * from [dbo].[#TEMP_ABI_PROCESS]
end

Nouman Zaheer
Software Engineer
MSR
 
You normally get that error because you're trying to insert a value into a field that is larger than that field.

I'd say check the values you're inserting against the column lenght.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top