Re: Cannot send UTF-8 chars to MSSQL 2008

Niklas Lampén <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
> > 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

_______________________________________________
FreeTDS mailing list
[email protected]
http://lists.ibiblio.org/mailman/listinfo/freetds
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.