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

x
?
Solved

How to convert text to nvarchar?

Posted on 2009-03-30
1
Medium Priority
?
543 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
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 UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

609 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