Update EMPS
Set TextName='Foo-Bar'
where empid = 1
is giving this error?
Server: Msg 8152, Level 16, State 9, Line 1
String or binary data would be truncated.
The statement has been terminated.
It seems that the hyphen/dash is causing the problem but I don't know why.
If I remove the dash it works just fine. Unfortunately, I need the dash.
BTW,
TextName is a varchar(20).
Does this have anything to do with QUOTED_IDENTIFIER?
How could I escape the dash?
Thanks ... Ed
--
Doo
Senior Data Architect / DBA
PlanetJam Media Group
"Ed Staffin" <e...@staffin.com> wrote in message
news:uaz$Po$UAHA...@cppssbbsa02.microsoft.com...
Mike
Hope this helps.
Gert-Jan
Doo wrote:
> That's a valid statement...something else is going wrong somewhere.
>
> --
> Doo
> Senior Data Architect / DBA
> PlanetJam Media Group
>
> "Ed Staffin" <e...@staffin.com> wrote in message
> news:uaz$Po$UAHA...@cppssbbsa02.microsoft.com...
> > I'm confused. Can someone please tell me why the simple insert statement
> >
> > Update EMPS
> > Set TextName='Foo-Bar'
> > where empid = 1
> >
> > is giving this error?
> >
> > Server: Msg 8152, Level 16, State 9, Line 1
> > String or binary data would be truncated.
> > The statement has been terminated.
> >
> > It seems that the hyphen/dash is causing the problem but I don't know why.
> > If I remove the dash it works just fine. Unfortunately, I need the dash.
> > BTW,
> > TextName is a varchar(20).
> >
> > Does this have anything to do with QUOTED_IDENTIFIER?
> > How could I escape the dash?
> > Thanks ... Ed
> >
> >
> >
> >
> >
--
(Please reply only to the newsgroup)
"Gert-Jan Strik" <g...@ietsmet.nl> wrote in message
news:3A1AE935...@ietsmet.nl...
"Mike Drewery" <m...@nospam.com> wrote in message
news:#Db9K#$UAHA...@cppssbbsa02.microsoft.com...
> Try this I posted it in your other thread and it works.
> Update EMPS
> Set TextName="Foo-Bar"
> where empid = 1
>
> Mike
Q. What is a reproduction (repro) script used to report a SQL Server bug?
A. In order for Microsoft to resolve a bug they need to re-create it on their
systems. The best way to do this is to provide them with a repro script. They
don't have access to your database, so the script needs to be able to show the
problem when run on a brand-new install of SQL Server on a new database.
Therefore it needs to contain all tables, user defined data types, triggers,
views and any other objects, needed to show the problem. If it needs data then
keep this to a minimum - use INSERT INTO <tbl> VALUES (.....) type statements
if possible. If not a small (zipped) amount of BCP data is ok.
Alternatively re-write your query (if possible) to run against the pubs or
Northwind (SQL 7.0 and above only) databases as these are always installed with
SQL Server and come complete with a variety of tables, foreign keys, indices,
data etc.
If the script/data is reasonably short then post to one of the newsgroups and
one of MVP's can report it to Microsoft for you.
If it isn't short or a repro script is not practical due to the amount of
information/data needed then you will need to raise a bug with Microsoft PSS
directly. (See MSPSS FAQ entry for details)
An example repro script below :-
--
-- Bug Title : Access violation
--
--
-- Versions affected : SQL 6.5
--
--
-- Fixed in : SQL 7.0
--
--
-- Microsoft incident / bug number : unknown/16767
--
--
-- Bug Description.
--
print
'
As title
'
--
-- Actual Repro script below here
--
use tempdb
go
CREATE TABLE table1
(
id int
)
GO
CREATE TABLE table2
(
id int
)
GO
CREATE TABLE table3
(
id int
)
GO
CREATE VIEW view1 AS
SELECT id
FROM table1
UNION ALL
SELECT id
FROM table2
GO
SELECT view1.id
FROM view1, table3
WHERE view1.id *= table3.id
GO
===
v1.05 2000.04.16
Applies to SQL Server versions : All
FAQ Categories : Troubleshooting
Related FAQ articles : bugreport, mspss
Related Microsoft Kb articles : n/a
Other related information : n/a
Authors : Neil Pike
Neil Pike MVP/MCSE. Protech Computing Ltd
Reply here - no email
SQL FAQ (484 entries) see
http://forumsb.compuserve.com/gvforums/UK/default.asp?SRV=MSDevApps
(faqxxx.zip in lib 7)
or www.ntfaq.com/Articles/Index.cfm?DepartmentID=800
or www.sqlserverfaq.com
or www.mssqlserver.com/faq
Dean.
"Ed Staffin" <e...@staffin.com> wrote in message
news:On9i#lAVAH...@cppssbbsa02.microsoft.com...
Maybe the trigger logic is causing the error in this situation, rather than
the update statement itself.
Dean.
"Ed Staffin" <e...@staffin.com> wrote in message
Best Regard,
Wesley Tam
In article <uaz$Po$UAHA...@cppssbbsa02.microsoft.com>,
"Ed Staffin" <e...@staffin.com> wrote:
> I'm confused. Can someone please tell me why the simple insert
statement
>
> Update EMPS
> Set TextName='Foo-Bar'
> where empid = 1
>
> is giving this error?
>
> Server: Msg 8152, Level 16, State 9, Line 1
> String or binary data would be truncated.
> The statement has been terminated.
>
> It seems that the hyphen/dash is causing the problem but I don't know
why.
> If I remove the dash it works just fine. Unfortunately, I need the
dash.
> BTW,
> TextName is a varchar(20).
>
> Does this have anything to do with QUOTED_IDENTIFIER?
> How could I escape the dash?
> Thanks ... Ed
>
>
--
My Profiles http://profiles.yahoo.com/WESLEY1973
My Voice Box: (909) 752-9341
My Fax: (909) 752-9356
My ICQ# 17776893
My Email: lok...@gate.net______no_spam
Sent via Deja.com
http://www.deja.com/