DECLARE @Id BIGINT
DECLARE @FileName AS VARCHAR(50)

DECLARE cList CURSOR FOR
     SELECT 
		Id, FileName
     FROM 
		dbo.tblFile;
  
     OPEN cList 
     FETCH NEXT FROM cList INTO @Id, @FileName   
     WHILE @@FETCH_STATUS = 0  
     BEGIN  

		PRINT @FileName

        FETCH NEXT FROM cList INTO @Id, @FileName   
     END
    
CLOSE cList
DEALLOCATE cList

Last modified: August 28, 2019

Author

Comments

Write a Reply or Comment