![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
is it possible to execute into a table. i.e store the output of the code below into a table DECLARE tables_cursor CURSOR FOR SELECT distinct tbname FROM maxsyscolumns OPEN tables_cursor DECLARE @tablename varchar(30) FETCH NEXT FROM tables_cursor INTO @tablename WHILE (@@fetch_status <> -1) BEGIN declare @tname varchar(128) set @tname = @tablename EXEC ('Select '''+ @tname +''', count(*) from '+@tablename) FETCH NEXT FROM tables_cursor INTO @tablename END DEALLOCATE tables_cursor many thanks |
#3
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |