mssql adapters are quite messy.
MSSQL2Adapter is the adapter that uses 'nvarchar' as type, however it 
inherits from MSSQLAdapter, given that it doesn't have the features of 
MSSQL4Adapter.
For backward compatibility I don't think MSSQL2Adapter will be never 
updated to inherits from MSSQL4Adapter.
My suggestion is to create your own adapter, something like that should work
from pydal.adapters import ADAPTERS, MSSQL4Adapter, MSSQL2Adapter
class MyMSSQLAdapter(MSSQL2Adapter, MSSQL4Adapter):
    pass

ADAPTERS.update( {
    'mymssql': MyMSSQLAdapter
})
db = DAL('mymssql://user:pass@host/database')

Your new adapter will have the types of MSSQL2Adapter, the methods of both.

Paolo

On Wednesday, April 15, 2015 at 3:22:10 AM UTC+2, Ray (a.k.a. Iceberg) 
wrote:
>
> Hi there,
>
> Long story short, I am now working in a project with web2py trying to 
> connect to a MSSQL database. My team tends to use the connect string as 
> "mssql4://..." to take the advantage of the (latest and greatest?) 
> MSSQL4Adapter, however we also notice from the dal source code mssql.py 
> that, MSSQL4Adapter defines "string" as "VARCHAR", while an older 
> MSSQL2Adapter defines "string" as "*N*VARCHAR".
>
> It seems there is some other opinion in favor of "NVARCHAR" 
> <http://stackoverflow.com/questions/144283/what-is-the-difference-between-varchar-and-nvarchar>
>  for 
> internationalization reason. But then why the web2py MSSQL4dapter chooses 
> "VARCHAR" instead of "NVARCHAR"? Any insight?
>
> Thanks in advance!
>
> Regards,
> Ray
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to