In SQL Server 2017 STRING_AGG function has been added
SELECT t.name as TableName
,STRING_AGG(c.name, ';') AS FieldList
FROM sys.tables t
JOIN sys.columns c
ON t.object_id = c.object_id
GROUP BY t.name;
More Related Contents:
- How to concatenate text from multiple rows into a single text string in SQL Server
- Import CSV file into SQL Server
- Concatenate row values T-SQL
- Where value in column containing comma delimited values
- How can I combine multiple rows into a comma-delimited list in SQL Server 2005?
- How to get export output in “real” CSV format in SQL Server Management Studio?
- Errors in SQL Server while importing CSV file despite varchar(MAX) being used for each column
- SQL, How to Concatenate results?
- What is wrong with this DB Diagram? [closed]
- I’m getting ‘Column name is invalid in the select list’ error when i execute the query
- Efficiently convert rows to columns in sql server
- Not equal != operator on NULL
- How can I select the first day of a month in SQL?
- Copy tables from one database to another in SQL Server
- error, string or binary data would be truncated when trying to insert
- Is it possible to specify condition in Count()?
- Why is a UDF so much slower than a subquery?
- Is it possible to run multiple DDL statements inside a transaction (within SQL Server)?
- SQL comma-separated row with Group By clause
- Get everything after and before certain character in SQL Server
- T-SQL trim   (and other non-alphanumeric characters)
- I want to use CASE statement to update some records in sql server 2005
- Sql Server trigger insert values from new row into another table
- How to return a incremental group number per group in SQL
- Retrieve column names and types of a stored procedure? [duplicate]
- Zero SQL deadlock by design – any coding patterns?
- UNION ALL vs OR condition in sql server query
- How to create a Date in SQL Server given the Day, Month and Year as Integers
- Count records for every month in a year
- How can I find Unicode/non-ASCII characters in an NTEXT field in a SQL Server 2005 table?