SQL

sql issue with cast

was working with a quick query to find some data in a netxt field containing a comma-seperated list of countries, so i wrote: select id, countries from tablea where cast(countries as varchar) LIKE '%mozambique%' this didn't return the number of rows i expected so i investigated further. it seems that using cast() in this way (without specifiying a length) creates a varchar of default length. if a string in my ntext fields is longer than this length thestring is terminated. hmm, fun. my curiosity...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

«February»
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
26272829123
45678910