Aşağıdaki örnek kod ile STE_EMAILS tablosundaki emails kolonunu PRINT ediyoruz.
DECLARE @email NVARCHAR(255) DECLARE MyCursor CURSOR FOR SELECT email FROM STE_EMAILS OPEN MyCursor FETCH NEXT FROM MyCursor INTO @email WHILE @@FETCH_STATUS = 0 BEGIN PRINT '%' + @email + '%' FETCH NEXT FROM MyCursor INTO @email END CLOSE MyCursor DEALLOCATE MyCursor
But TRUNCATE TABLE is faster and uses fewer system and transaction log resources than DELETE.
Hi Alejandro,
“Truncate Table” is faster but you can not use this command when your table includes Foreign Keys.
Another fact is, if you want to delete spesific records on a table, you can only use delete command.