Solved

How to convert text to nvarchar?

Posted on 2009-03-30
1
532 Views
Last Modified: 2012-05-06
I'm trying to insert all the users from an old database to the new one.
I got this error message:
"Server: Msg 260, Level 16, State 1, Line 2
Disallowed implicit conversion from data type text to data type nvarchar, table 'RC_DB3.dbo.tbl_Referral', column 'CaseNotes'. Use the CONVERT function to run this query."

Here is my code:
      insert into RC_DB3.dbo.tbl_Referral (RC_DB3.dbo.tbl_Referral.ID, RC_DB3.dbo.tbl_Referral.Status, RC_DB3.dbo.tbl_Referral.DateOfReferral, RC_DB3.dbo.tbl_Referral.FirstName, RC_DB3.dbo.tbl_Referral.LastName, RC_DB3.dbo.tbl_Referral.DateOfBirth, RC_DB3.dbo.tbl_Referral.Gender, RC_DB3.dbo.tbl_Referral.Ethnicity,CaseNotes)
      select RC_DB2.dbo.rc_Referrals.ReferralID, RC_DB2.dbo.rc_Referrals.ReferralStatus, RC_DB2.dbo.rc_Referrals.ReferralDateTime, RC_DB2.dbo.rc_Referrals.FirstName, RC_DB2.dbo.rc_Referrals.LastName, RC_DB2.dbo.rc_Referrals.DOB, RC_DB2.dbo.rc_Referrals.Gender, RC_DB2.dbo.rc_Referrals.Ethnicity, RC_DB2.dbo.rc_Referrals.Comments from RC_DB2.dbo.rc_Referrals


The problem is on the old one Comments = text 16 and on the new one CaseNotes = nvarchar 255.


How can I transfer this values?
0
Comment
Question by:Romacali
1 Comment
 
LVL 1

Accepted Solution

by:
sqlman08 earned 500 total points
ID: 24024536
Convert(nvarcar(255),yourfieldname)
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

747 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now