?
Solved

How to convert text to nvarchar?

Posted on 2009-03-30
1
Medium Priority
?
542 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
[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
1 Comment
 
LVL 1

Accepted Solution

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

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.
Suggested Courses

771 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