Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
tedmanowar
Starting Member
31 Posts |
Posted - 2008-05-28 : 06:15:54
|
Hello,I am trying to figure out why does my SQL Server stores question marks (?) instead of (e.g.) Cyrillic characters that come through a web page...If I don't use the N prefix in my queries will I be able to solve the problem through the database's collation settings?I am using SQL Server 2008, the DB fields in Question are ALL of NVARCHAR type.Thanks in advance.TedManowar |
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2008-05-28 : 09:19:33
|
Ted --Show us a snippet of your code (both web code and t-sql code, as necessary) and we can take a look. hard to guess what the issue is without seeing what you are specifically doing.Also -- are you using parameters or concatenation when executing the SQL to store your web input in the database? If you declare and set parameters of the proper data types (NVARCHAR) you will be fine with any unusual characters (and safe from injection!), but if you are concatenating things into sql strings then there may be issues with string conversions. Yet another reason to always use parameters. - Jeffhttp://weblogs.sqlteam.com/JeffS |
 |
|
tedmanowar
Starting Member
31 Posts |
Posted - 2008-05-28 : 09:30:59
|
After having another look into the problem, I realized that the commands that cause the problems are actually concatenated SQL statements in some old part of the web app.So, after re-writing those commands with the use of idbparams it all works fine now.I don't think you can actually solve the problem on the database level anywayTedManowar |
 |
|
|
|
|