Fun stuff with SQL Server
Tip: Get list of columns for the table
When you dealing with dynamic SQL or unknown table structure, SQL meta data could help recover the missing information. There are two main system tables which give you such information: dbo.sysobjects dbo.syscolumns Example below shows how to gather column list for specified table. DECLARE @TABLENAME varchar(256), @COLUMNS varchar(4000) SET @TABLENAME Read more…