General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old November 20th, 2002, 08:58 AM
rgesse rgesse is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Posts: 2 rgesse User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
ntext and MSSQL problem

Just some helpful information for php developers.

I had some serious problems with ntext data types in MSSQL. I would get the following error when attempting to extract data from an ntext field in a table:

MS SQL message: ntext data cannot be sent to clients using DB-Library (such as ISQL) or ODBC version 3.7 or earlier. (severity 16)

At bugs.php.net the problem is as follows according to the people at php.net:

"Unfortunately the ODBC functionality is based off of ODBC v2, which means NTEXT, TEXT, and pretty much any UNICODE is unknown to PHP. Marking this as closed as there is no way to really fix this, without overhauling the entire ODBC system (which is in progress, but no promises)"

and another response to the same problem:

"This is not an error in the MS SQL extension, as you are using ODBC functions to fetch data. Microsofts new datatypes ntext and nvarchar is not suported in the MS SQL extension, as they are not supported in Microsofts C-library. The will always be returned as a varchar with a max length of 255 bytes. "

Fortunately I was able to come up with a cluggy solution. I solved it using a cast: SELECT cast ( field_name AS TEXT ) AS field_name.

Unfortunately you must also run the following query PRIOR to running the select.

@mssql_query( "SET TEXTSIZE 1024000", $db_connect);

The TEXTSIZE sets the max length of field content that should be returned.

Just thought I'd post a solution to something that was highly frustrating and annoying to me. I've received lots of help from php's community in the past and thought I'd give somrthing back ;-)

Hope this helps someone .

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > ntext and MSSQL problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT