How to fetch row one by one in sqlI am fetching tablename from perticular database like this
SELECT name FROM sys.Tables where name like 'some pattern'
It can give me more than one row like above output. How to fetch row one by one. Because I want to find out columnname/date from obtained table name.If date is less than current date,I want to delete/drop that table.
select top 1 Udate from sampletable_123
where Udate < convert(varchar(10),getdate(),101)
delete table sampletable_123.How to do that?