In SQL Server, I would like to see Table_Name and all the columns associated with this Table_Name in the database. So the output should look like this:
TABLE_NAME COLUMN_NAME 1. Employee Employee-id, Lastname, Firstname, Title........... 2. Orders Orderid, Order-date, shipped-date, delivery-date....... 3. Products Product-id, Product-name, supplier-id, category-id..... 4. Suppliers Supplier-id, Company-name, contact-name....... 5. ............................................................ 6. ................................................... (So on....)
Is it possible to get the above results using WHILE LOOP or any other way? If YES, can you post the code.
In addition, I tried to make this problem using the Temp table:
create table
I was able to list the columns vertically, but I could not get a list of columns separated by commas.
source share