Questions tagged [stuff]
The STUFF function inserts a string into another string. It deletes a specified length of characters in the first string at the start position and then inserts the second string into the first string at the start position.
16
questions
0
votes
1answer
17 views
What is the symbol/s for spacebar press when using the `screen stuff` command?
I have a screen command as such..
screen -S sessionname -X stuff 'spacebar'
I want to replace "spacebar" with the appropriate symbol/s to emulate a spacebar press. I would also like to know ...
0
votes
1answer
43 views
“Stuff and 'For Xml Path'” or UNION to exclude duplicate rows
This is further progress of question here: how to use "Stuff and 'For Xml Path'" to unite rows in table
I have 3 tables - invoices, positions and accounts which build common table by ...
1
vote
2answers
44 views
how to use “Stuff and 'For Xml Path'” to unite rows in table
Please help me to get united rows and list of accounts separated by commas in table. I don't quite understand how to use "Stuff and 'For Xml Path'" for it.
This is my query:
CREATE TABLE ...
-1
votes
2answers
22 views
SQL SERVER: concatenate node values of XML column
I have the following table that holds a column which is in XML:
Id
Label
Details
1
Test1
<terms><destination><email>email11@foo.com</email><email>email12@foo.com</...
0
votes
1answer
33 views
Concatenate comma separated strings using STUFF
I want to concatenate comma-separated string. I have a query where I am using the function to get the staff.
Currently, I am using [dbo].fn_fullname(A.REFNO) as Staff to get the staff but I want to ...
1
vote
1answer
40 views
SQL server query to search and stuff multiple rows
I have table employee_table which is like this
org employeeid (int) firstname lastname
1234 56788934 Suresh Raina
1234 56793904 Virat Kohli
then i have ...
1
vote
1answer
54 views
String aggregate in legacy in sql server
I have this table
grid_id | criteria_id | start_value| end_value | provider | property1 | property2 | property3
--------|-------------|------------|-----------|----------|-----------|-----------|------...
1
vote
2answers
157 views
Create comma separated value strings using data from different tables in SQL Server
I have the following database model:
criteria table:
criteria_id criteria_name is_range
1 product_category 0
2 product_subcategory 0
3 items ...
0
votes
1answer
27 views
How to return blank or null record when using STUFF and XML PATH on SQL Server 2016?
I am using STUFF and XML PATH as it is obligatory that I use SQL Server 2016. I have been working on this query and I cannot figure out how to return null or blank record when using STUFF and XML PATH....
0
votes
1answer
57 views
Use STUFF() on a result set coming from OPENJSON
I have a ClassTable as shown below with a Languages column in which the data is in JSON:
ID
Title
Languages
1
Class1
[{"ID": 1, "Name": "English"},{"ID": 2, &...
0
votes
0answers
14 views
How to use Overlay in TypeORM
I can use Overlay in PostgreSQL like this:
select overlay(user_image placing 'https://www.backend.com' from 1 for 1) from book_requests where id = '8cfea8bf-61b3-4507-b5ee-68593c5c02a0';
to change ...
-1
votes
1answer
27 views
Using the STUFF function in update
Can someone tell me why this use of the STUFF function will not work?
UPDATE table
SET STUFF(address, LEN(TRIM(address)) - 2, 2, 'Drive')
WHERE RIGHT(TRIM(address), 3) =' DR'
Is it because the insert ...
0
votes
2answers
49 views
T-SQL MS SQL Stuff. How to combine rows into single row with group by
I have a SQL Query:
SELECT [B].[Id]
,[B].[CreateDate]
,[Author]
,[B].[WorkcenterId]
,[B].[AreaId]
,[B].[SubAreaId]
,[B].[Description]
,[PriorityId]
,[...
0
votes
1answer
66 views
String split ,sort and compare with another column within a table SQL
Create Table #temp
(
Change varchar(20),
deleted_user_id int,
deleted_field_id int,
deleted_value nvarchar (4000),
inserted_user_id int,
inserted_field_id int,
inserted_value nvarchar (4000),
...
1
vote
2answers
40 views
How to separate unique values respective to its row using STUFF and FOR XML PATH
I'm running this query:
SELECT A.PeripheralNumber, P.LoginName, P.FirstName, P.LastName, A.EnterpriseName, A.AgentDeskSettingsID, AttributeValues =
STUFF((SELECT ',' + ATT.EnterpriseName+'='+AT....
398
votes
9answers
605k views
How Stuff and 'For Xml Path' work in SQL Server?
Table is:
Id
Name
1
aaa
1
bbb
1
ccc
1
ddd
1
eee
Required output:
Id
abc
1
aaa,bbb,ccc,ddd,eee
Query:
SELECT ID,
abc = STUFF(
(SELECT ',' + name FROM temp1 FOR XML PATH (...