Solved

How to convert text to nvarchar?

Posted on 2009-03-30
1
539 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 500 total points
ID: 24024536
Convert(nvarcar(255),yourfieldname)
0

Featured Post

Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Can we attach PDF to table 2 46
EF5 How do I stop pre-compiled views? 8 51
Any benefit to adding a Clustered index here? 4 37
Search Text in Views 2 27
Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
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.
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.

732 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