question

DSukh avatar image
DSukh asked

Concat not working on Web Edition

I have a very simple Concat query, it works on Standard Edition , but when I am migrating to Web Edition, this query does not work. (it does not concatenate) query : select [disbursements] + 'xyz' from Results. and disbursements is nvarchar[4000] datatype. I have tried concat, creating a new column with , nothing seems to be working, so far only substring turned out to help with concat, however I am struggling to substring the string and more importantly why would it work on Standard and not on Web Any help appreciated
concatenationsubstring
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

sjimmo avatar image sjimmo commented ·
What version of SQL Server are you using, both Standard and Web? Also, what is the sql code that you are trying to use?
0 Likes 0 ·
ThomasRushton avatar image ThomasRushton ♦♦ commented ·
and what error message are you getting?
0 Likes 0 ·
borispinsky avatar image
borispinsky answered
Concat function was added in sql server 2012. So if your web edition is lower then 2012 use " + " instead
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

DSukh avatar image
DSukh answered
Hi, I am using Microsoft SQL Server 2014 - 12.0.4213.0 (X64) Copyright (c) Microsoft Corporation Enterprise Evaluation Edition (64-bit) on Windows NT 6.3 (Build 9600: ) edition for standard and for web Microsoft SQL Server 2014 - 12.0.4100.1 (X64) Copyright (c) Microsoft Corporation Web Edition (64-bit) on Windows NT 6.2 (Build 9200: ) (Hypervisor) There is no error, it just does not concatenate the nvarchar(4000) with any string. My query is select [disbursements]+ 'xyz' from Results. This runs on the Standard edition, however when I run it on the Web edition, it does not concatenate. I have tried + , concat function, creating a new column for 'xyz' and then concatenating the 2 columns, none of these seem to work. Only if I substring the disbursements column and then concatenate with 'xyz' it works. I was assuming there are some /n or carriage return characters so have removed them still concat not working. So just wondering if Web edition has any limitations with + or concat, as it seems to work perfectly on Standard
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

srutzky avatar image srutzky commented ·
This is not an answer. This is additional detail that should be added to the main question. Please update the question with this info and then delete this answer.
1 Like 1 ·
sjimmo avatar image
sjimmo answered
To my knowledge there are no limitations/bugs. But try this code: select convert(varchar(100), [disbursements]) + 'xyz' from Results There may be some upper ascii characters in your disbursements field that you can't see. This won't clean it up, but may force it to work while you can research the data.
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

borispinsky avatar image borispinsky commented ·
Do you have nulls in disbursements column? try to use isnull().. select isnull([disbursements],'') + 'xyz' from Results
0 Likes 0 ·
DSukh avatar image
DSukh answered
I tried the above, but it is still not concatenating and no errors either
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

srutzky avatar image srutzky commented ·
Why are you posting new answers as responses to comments? You should add comments on other people's answers in reply to them and/or update your question with additional details. Please add your responses to those areas and delete these answers. Thanks.
1 Like 1 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.