Text to NText, Varchar to NVarchar
843854Feb 8 2005 — edited Jun 22 2005Hello,
I currently have an app on SQL Server which has text and varchar datatypes throughout. I've noticed that some characters that are entered into the database get stored as ?. This problem went away when I changed one of my text fields into "ntext". So now I'm thinking that I need to change all varchars to nvarchars, and all text types to ntext. This would at least allow me to store any characters my users could throw at the app, unicode or not.
What difficulties should I expect when I do this? I've seen lots of posts regarding difficulties inserting and retrieving data that is ntext or nvarchar, but many of these posts are old (2001 or earlier), or use different JDBC drivers (I'm using the INET driver). I don't know which of these issues will catch up to me. It sounds like I will need to modify a lot of my sql, but I'm not sure where yet. Can anyone post some of their experiences when making this conversion? What changes did you have to make to get things to work? I use many Statement objects and PreparedStatement objects, using stmt.setString(), rs.getString()., etc....
Michael