Solved

How to convert text to nvarchar?

Posted on 2009-03-30
1
536 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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Sql server function help 15 31
Update a text value in another table 10 41
Show Results for Latest DateTime in a View 27 25
Tsql query 6 22
Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
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…

821 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