I'm trying to get a result from our db with one identifier (ArtNr) and one big chunk of text that also contains returns (Edit), I also want the text from the (Edit) column to be stringed? (like this: "texttexttext" it's the "" I need in the beginning and end of the text)
I have come up with the query below but it only gives 1 row in reply (should be like 4000) and it does of course not give me the Edit captioned with "" since I have no clue how to do it :)
Thanks in advance! /Christian
USE MSPes2t
DECLARE @result nvarchar(max) , @test nvarchar(255)
SELECT @result = AR.Edit , @test = AR.ArtNr
FROM DBO.AR
WHERE AR.ArtNr = '%'
ORDER BY AR.ArtNr
SELECT @test AS artnr,
@result AS edit
This is the result im searching for:
Like this:
ArtNr | Edit
------+----------------------------------------
12001 | "edit"
12002 | "edit"
28001 | "edit"