LISTING 4: Code That Generates Descriptions for All Tables in a Database DECLARE @table varchar(80) DECLARE tab_desc cursor FOR SELECT name FROM sysobjects WHERE type = 'U' OR type = 'S' OPEN tab_desc FETCH next FROM tab_desc INTO @table WHILE @@fetch_status = 0 BEGIN PRINT @table + char(13) + char(10) EXEC sp_desc @table FETCH next FROM tab_desc INTO @table END CLOSE tab_desc DEALLOCATE tab_desc GO