Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

concatenate Expand / Collapse
Author
Message
Posted Tuesday, April 23, 2013 3:33 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Friday, March 25, 2016 4:22 PM
Points: 62, Visits: 249
ok thanks changing them to a varchar works now.
Post #1445703
Posted Tuesday, April 23, 2013 3:50 PM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Wednesday, April 27, 2016 1:45 PM
Points: 15,549, Visits: 15,699
Mansfield (4/23/2013)
Text, ntext and image are special data types that does not support the normal string operators.
If you want to concatenate, you'll need to cast each field into varchar or nvarchar first.


And they have all been deprecated. Please consider changing your base tables to (n)varchar(max).

Of course I doubt you really need varchar(max) here because varchar can hold up to 8,000 characters. You can figure out how long your real data is with

select max(len(cast(YourTextColumn as varchar(max)))) as MaxLen



_______________________________________________________________

Need help? Help us help you.

Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

Need to split a string? Try Jeff Moden's splitter.

Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Understanding and Using APPLY (Part 1)
Understanding and Using APPLY (Part 2)
Post #1445708
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse