DECLARE @schemaName nvarchar(50) --DECLARE @TableName nvarchar(1000) DECLARE column_to_row CURSOR FOR --List of tables that we want to unpivot columns as row -- kolonlari alinacak tablo listesi SELECT 1 OPEN column_to_row; FETCH NEXT FROM column_to_row WHILE @@FETCH_STATUS = 0 BEGIN DECLARE @TableName nvarchar(4000)=NULL SELECT @TableName=COALESCE(@TableName+',','')+t.TABLE_SCHEMA+'.'+o.Name+char(13) FROM sysindexes AS i INNER JOIN sysobjects AS o ON i.id = o.id INNER JOIN INFORMATION_SCHEMA.TABLES T ON T.TABLE_NAME=o.name WHERE i.indid < 2 AND OBJECTPROPERTY(o.id, 'IsMSShipped') = 0 AND i.rowcnt >10000000 AND i.rowcnt <=50000000 AND o.name NOT LIKE '%Temp_MesajHareketDB%' AND o.name NOT LIKE '%Temporary%' AND o.xtype !='TF' ORDER BY o.name ASC FETCH NEXT FROM column_to_row PRINT (@TableName) END CLOSE column_to_row DEALLOCATE column_to_row