concat multi rows field
-
Hi. I want to concat some row field in a string. for example its my view name id ---- --- RRR 3 eee 1 ddd 3 i want to pass the id "3" to my function and get the "RRR ddd" as my result.
sepel
You don't say what's your problem exactly. Create a function where id is passed as parameter and varchar as return type. In the function you fetch and concatenate the strings. Refer to CREATE FUNCTION (Transact-SQL)[^].
The need to optimize rises from a bad design. My articles[^]
-
You don't say what's your problem exactly. Create a function where id is passed as parameter and varchar as return type. In the function you fetch and concatenate the strings. Refer to CREATE FUNCTION (Transact-SQL)[^].
The need to optimize rises from a bad design. My articles[^]
-
Tank you.
Mika Wendelius wrote:
In the function you fetch and concatenate the strings
My problem is That function. How i should Fetch rows?
sepel
Create a cursor, open it and loop through it. See: DECLARE CURSOR (Transact-SQL)[^].
The need to optimize rises from a bad design. My articles[^]
-
Create a cursor, open it and loop through it. See: DECLARE CURSOR (Transact-SQL)[^].
The need to optimize rises from a bad design. My articles[^]