Skip to Content.
Sympa Menu

freetds - Re: [freetds] Cannot send UTF-8 chars to MSSQL 2008

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Niklas Lampén <Niklas.Lampen AT eventusmedia.fi>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Cannot send UTF-8 chars to MSSQL 2008
  • Date: Fri, 4 Jun 2010 14:55:45 +0300

> > Calling stored procedure with tsql
> > 1> EXECUTE Mod_Text_Put_Content @ContentId=6824, @Content=N'Найти',
> @SiteId='niklas'
> > 2> go
> > is a success, too. Now I just have to figure out how to submit that
> data from PHP with this Unicode marking N. I can choose field types for
> mssql_bind()
>
> I can only suggest that you don't really need mssql_bind/mssql_execute
> if you are only using input parameters.
>
> You could simply use mssql_query("EXECUTE Mod_Text_Put_Content
> @ContentId=6824, @Content=N'Найти', @SiteId='niklas'");
>
> Just make sure to properly escape ' characters.
>
> 7 years ago when I last had access to a copy of MS SQL Server and last
> used FreeTDS, _bind/_execute were so unreliable we just converted all
> stored procedures to use input parameters only.

Ok. That makes sense and now when I think about it, I don't even think that
would be too hard to do. I have wrapped each and every call of mssql_* to a
class, so I only need to change the code in one place. It should not be too
hard to build an EXECUTE call from current Init(), Bind(), and Execute().

Thank you for your help and comments!


Niklas




Archive powered by MHonArc 2.6.24.

Top of Page