I have the table:
CREATE TABLE [address_tabletype] (
[CONTROL_NUMBER] [varchar](12) NULL,
[ADDRESS1] [varchar](50) NULL,
[ADDRESS2] [varchar](50) NULL,
[CITY] [varchar](50) NULL,
[STATE] [varchar](2) NULL,
[ZIP] [varchar](10) NULL
)
GO
and, say I have the following rows:
2506387 1 2 3 4 5
2506394 1 2 3 4 5
2506403 1 2 3 4 5
I would like to to look like:
2506387|1|2|3|4|5~2506394|1|2|3|4|5~2506403|1|2|3|4|5
I haven't tried anything because I honestly have no idea where to start.
I am using SQL Server 2008 R2, and will be using a temp table to build this string.
EDIT
I am using this to pass to a 3rd party CLR Function that absolutely needs a delimited string in this fashion. I planned to send it over to the function, return it to the SP, break it down to its original form, and then return the results to the caller of the SP.
Thank you.