
(select Count(Tablestatus) from dbo.Backward where Tablestatus like ''%windows 98%'' or Tablestatus like ''%windows NT 5.1%'' or Tablestatus like ''%windows NT 5.0%'' or Tablestatus like ''%windows 95%'' PRINT = 'select ''' + + ''', count(*) as Total_Usage, SELECT name FROM sys.databases WHERE name LIKE 'BT_%' and name not like 'BTS_%' I keep getting the improper object name error.Īny suggestions on how to get this working properly? I am new to using Cursors DECLARE DBCURSOR CURSOR


I think I have the structure for Set improperly setup. Working on a script to Loop through databases to query one table that each Identical Database has with cursors then return result set to table for each database.
