I use Microsoft SQL Server 2012. How to select all tables from a specific database in 1 line through a separator.
Suppose there is a TestDB database with the panels panel, settings, temp, log. You need to conduct a query whose answer will be "panel | settings | temp | log" In essence, this information is
SELECT TABLE_NAME FROM TestDB.INFORMATION_SCHEMA.Tables Only here is how to convert this request to 1 line through the delimiter.
As I understand it, the group_concat function is not suitable for this task.
column_namewithtable_name, a comma with a vertical line, the name of the table with INFORMATION_SCHEMA.Tables. Check - works. total:SELECT STUFF( (SELECT '|' + table_name FROM INFORMATION_SCHEMA.Tables FOR XML PATH ('')) , 1, 1, '')- Mike