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
Comments