Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 sql escape sequence for double quotes ?

Author  Topic 

BitShift
Yak Posting Veteran

98 Posts

Posted - 2007-08-17 : 09:19:12
Im getting some sql errors from a php application which uses a sql server 2005 backend database. Part of the error description is "string or binary data would be truncated, sql state 22001 in sqlexecdirect".

One question - is passing something like 'some test here \"and here"\ and here and here' a possible issue ?

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-08-17 : 09:25:02
Check the length of the column. You need to increase length of that column or restrict users from entrering more than the allowed length

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

JoeNak
Constraint Violating Yak Guru

292 Posts

Posted - 2007-08-17 : 09:25:41
To answer your question, that string isn't an issue.
Go to Top of Page

BitShift
Yak Posting Veteran

98 Posts

Posted - 2007-08-17 : 10:28:41
Ok, thanks, thats what I thought - its most likely a data length issue and not a character escaping issue.

That makes me wonder though, are double quotes ever a problem with Sql or is it just single quotes that need to be escaped ?

Ive asked my user to try to reproduce the error and give me the data they were trying to add. My guess is they tried to copy and paste a huge amount of "stuff" from a word document...
Go to Top of Page
   

- Advertisement -