• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
mssql - active records - field lengths

#2
[eluser]Keeshond Loekie[/eluser]
I have found the cause of the issue and the solution:

http://www.php.net/manual/en/ref.mssql.php

Quote:marc at NOSPAM dot durdin dot net
19-Nov-2004 04:19
Buried away in the mssql_field_length documentation is an important limitation that it is certainly worth knowing about *BEFORE* you do any database design:

Note to Win32 Users: Due to a limitation in the underlying API used by PHP (MS DbLib C API), the length of VARCHAR fields is limited to 255. If you need to store more data, use a TEXT field instead.

SQL Server natively supports VARCHAR up to 8000 characters. Note that TEXT fields have substantially poorer performance (and are much more limited) than VARCHAR so you may want to design your databases accordingly...

You can also work around this limitation with the following:

-- for example, with MyVarCharField VARCHAR(1000)
SELECT CAST(MyVarCharField AS TEXT) FROM MyTable


Messages In This Thread
mssql - active records - field lengths - by El Forum - 04-15-2010, 09:18 AM
mssql - active records - field lengths - by El Forum - 04-15-2010, 09:58 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.