Hi,
I'm trying to do in sql server something that was very easy in Oracle Sql...
select col1||'''|'''||col2||'''|'''||col3||'''|'''||col4....etc from <usertable>
and I'd end up with a string with columns separated by a pipe (|) it would cope fine with dates not needing cast or convert etc...
There doesn't seem to be the equivalent in transact-sql used within sql server.
I appreciate that I have to cast date columns but the implication is that I can use the + operator but when I do so I get the message "Error converting varchar to numeric" implying it is trying to numerically add them together!!!
(e.g. select cast([timestamp] as varchar)+'|'+[No_]+'|'+ etc.... from <usertable> )
Any ideas what I'm doing wrong?
Thanks
Stephen
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Most Valuable Expert award recognizes technology experts who passionately share their knowledge with the community, demonstrate the core values of this platform, and go the extra mile in all aspects of their contributions. This award is based off of nominations by EE users and experts. Multiple MVEs may be awarded each year.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.