Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Unicode INSERT with Non-Unicode Database

Posted on 2012-03-29
6
Medium Priority
?
237 Views
Last Modified: 2012-08-13
Is it possible to use a unicode INSERT or UPDATE statement (i.e.: N'String') into a non-unicode database? I have that situation and it doesn't seem to throw any errors and does Insert the data correctly so far, which is surprising to me. What gotchas could I expect if any in this situation?

Application is a VB.NET 2005 app front-end to a SQL 2005 -2008 R2 database.
0
Comment
Question by:gcook17
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 20

Expert Comment

by:BuggyCoder
ID: 37785812
Make sure that the column datatype is NVarchar, Then if you insert hindi text into this column, to display it properly in SSMS you need to have that hindi font in which the text was written before bieng stored.

try testing it with websites that display regional or international language content, one such example in wikipedia....
0
 
LVL 84

Accepted Solution

by:
Dave Baldwin earned 2000 total points
ID: 37785930
String functions in the database server may have a problem when the characters don't match the collation.
0
 
LVL 14

Expert Comment

by:nishant joshi
ID: 37785980
please give a vb code that you have use for insert and update.
there is no relation between sql unicode and non unicode string and vb strings.
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 

Author Comment

by:gcook17
ID: 37787431
Here is an example of an INSERT query generated from the VB code:

INSERT INTO Orders ([ordernum],[department],[hours],[tasknum],[requestor],[status],VALUES (111,N'Facility Support Lines - XYZ',0,5196,N'No Requestor - 338',N'Active'

The application generates SQL for INSERTS and UPDATES. strings are prefixed with "N" to represent a unicode value. These SQL statements are executed against a SQL Server database.
0
 

Author Comment

by:gcook17
ID: 37787437
OK so one problem could be inserting unicode strings into a non-unicode database field could throw off the collation for that column. That's one issue.
0
 

Author Closing Comment

by:gcook17
ID: 37824082
This solution seems to be the only solution that relates to and affects the original question
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question