December 3, 2014 at 8:26 am
Figured out that the missing quote had nothing to do with the question but missed the part where text data type is used.
Are people still using those horrible data types? Is it difficult to migrate text/ntext columns to varchar(max)/nvarchar(max) columns?
December 3, 2014 at 8:48 am
When I read through the question, I saw what looks like eight extra apostrophes, not just the one in the pronunciation helper for "Grisham". However, the extra apostrophes in Dean Koontz's biography are actually what Microsoft calls "smart quotes" - the ones that are slanted, not vertical, and T-SQL doesn't care about those (nor does it care about the slanted quotation marks that are in there as well). It does care about the one in the pronunciation guide, however, which is ironic, since another one in "Grisham''s first bestseller" was correctly doubled.
I thought that the extra apostrophes were going to generate the error message, and didn't notice the use of LEN with a TEXT column, so I got the right answer for the wrong reason. :hehe:
Thanks for the good question, Kshitij, but you should have actually tried it first in SSMS with the biography text before submitting it.
December 3, 2014 at 9:05 am
Yeah, I've been bitten by text columns when I was unfamiliar with the schema.
Don Simpson
December 3, 2014 at 8:47 pm
Luis Cazares (12/3/2014)
Figured out that the missing quote had nothing to do with the question but missed the part where text data type is used.Are people still using those horrible data types? Is it difficult to migrate text/ntext columns to varchar(max)/nvarchar(max) columns?
Yes people are. Better yet is that MS products still use it.:sick:
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
December 8, 2014 at 1:13 pm
Emil Bialobrzeski (12/3/2014)
Koen Verbeeck (12/3/2014)
Nice question.The original INSERT statement misses one quote though.
But I figured out this was a typo and it had no influence on the answer. 😎
Regardless to it being a typo or not the answer is still the same 🙂 only the error message is different
Good point.
January 7, 2015 at 1:17 am
This is because LEN function does not work for text, ntext and image data types.
new things added in my mind memory...:-D
Manik
You cannot get to the top by sitting on your bottom.
Viewing 6 posts - 16 through 20 (of 20 total)
You must be logged in to reply to this topic. Login to reply