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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Issue with statement...

Status
Not open for further replies.
Mar 23, 2007
11
US
This query...

ALTER PROCEDURE sp_CoreTrack1
AS

SET NOCOUNT ON

INSERT CoreTracCustomerName
(
REC,
CCODE,
ATTN,
STREET,
CITY,
STATE,
ZIP,
FULL_NAME,
CON_FNAME,
CON_LNAME,
SS#
)
SELECT DISTINCT ct.CUSTNUM,
ct.TYPEGROUP,
ct.ATTN,
ct.STREET,
ct.CITY,
ct.STATE,
ct.ZIP,
ct.NAME,
SUBSTRING(ct.NAME, 1, NULLIF(CHARINDEX(' ', ct.NAME) - 1, -1)),
SUBSTRING(ct.NAME, CHARINDEX(' ', ct.NAME) + 1, LEN(ct.NAME)),
ct.SS#
FROM CoreTrack AS ct
WHERE ct.SS# > '0'
AND NOT EXISTS (SELECT * FROM CoreTracCustomerName AS ctcn WHERE ctcn.REC = ct.CUSTNUM)

SELECT @@ROWCOUNT



This returns the following error:



Server: Msg 8152, Level 16, State 9, Procedure sp_coretrack1, Line 6
String or binary data would be truncated.
The statement has been terminated.



Any suggestions?
 
Any suggestions?
Yes, find a more appropriate forum as ALTER PROCEDURE is not (AFAIK) an ANSI SQL instruction.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
String or binary data would be truncated.

This error occurs when you try to put too much data in to a column. For example, if you have a varchar(10) column put try to put more than 10 characters in to the column, you will get this error.

-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Right. The correct forum would be: forum183



-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top