Truncate (SQL)

TRUNCATE — у мовах, подібних до SQL, DDL-операція видалення усіх рядків таблиці. Логічно еквівалентна операції DELETE без оператора WHERE, однак часто виконується швидше та потребує менших ресурсів системи [1][2][3].

Синтаксис

Загальний синтаксис команди:

TRUNCATE TABLE <Ім'я Таблиці>

Наслідком виконання такої команди є повне видалення усіх рядків таблиці <Ім'я таблиці>. Причому сама таблиця залишається (на відміну від команди DROP TABLE)

Відмінності від оператора DELETE

Основні відмінності між операторами TRUNCATE та DELETE, що можуть бути в різних реалізаціях СУБД:

  • Операція TRUNCATE не записує до журналу подій (log-файл) видалення окремих рядків. Як наслідок, не активуються тригери.
  • Після операції TRUNCATE у деяких СУБД (наприклад, Oracle) відбувається неявна операція COMMIT. Тому видалені з таблиці записи не можна відновити операцією ROLLBACK. Втім, існують і СУБД, в яких операція TRUNCATE може брати участь у транзакціях, наприклад, Microsoft SQL Server.
  • Операція DELETE блокує кожний рядок, а TRUNCATE — усю таблицю.
  • Операція TRUNCATE не повертає якогось значення (зазвичай повертає 0) на відміну від DELETE, що повертає кількість видалених рядків.
  • Операція TRUNCATE, у деяких СУБД (наприклад, у MySQL, де вона еквівалентна послідовності команд DROP TABLE ... та CREATE TABLE ... [2]), обнуляє значення лічильників (для полів з AUTOINCREMENT).

Загалом, реалізація оператора TRUNCATE може залежати від вибору конкретної СУБД. Тому в кожному випадку слід читати документацію відповідної системи.

Джерела

  1. Электронная документация по SQL Server 2008 (июль 2009 г.). Оператор TRUNCATE TABLE. Microsoft. Архів оригіналу за 25 квітня 2012. Процитовано 14 травня 2010.
  2. а б MySQL Documentation. TRUNCATE TABLE Syntax. Архів оригіналу за 25 квітня 2012. Процитовано 14 травня 2010.
  3. Oracle® Database SQL Reference. 10g Release 2 (10.2). Oracle Corporation. Архів оригіналу за 25 квітня 2012. Процитовано 14 травня 2010.

Read other articles:

Piattaforma di Opposizione - Per la VitaОпозиційна платформа — За життяОппозиционная платформа — За жизнь PresidenteJurij BojkoVadym Rabinovyč Stato Ucraina AbbreviazioneOPZŽ Fondazione9 novembre 2018 Dissoluzione23 aprile 2022 Confluito in Piattaforma per la Vita e la Pace (euroscettici) Vostanovlennja Ukrainy e Servitore del Popolo (liberali) Nostri (filorussi) IdeologiaInteressi della minoranza russaEuroscetticismoSto…

جزء من سلسلة مقالات حولالتنجيم خلفية تاريخ التنجيم العلم والتنجيم علم الفلك والتنجيم التقاليد والأنواع والأنظمة المنجمون المنظمات الفلكية الكواكب في علم التنجيم التقاليد التنجيم البابلي علم التنجيم الهلنستي التنجيم في الإسلام خلال العصور الوسطى علم التنجيم الغربي علم ا…

Frédéric MoncassinFrédéric Moncassin lors du Paris-Nice 1997InformationsNaissance 26 septembre 1968 (55 ans)ToulouseNationalité françaiseÉquipes amateurs 1989CSM Persan-Bic-MBKÉquipes professionnelles 09.1989-12.1989Super U-Raleigh-Fiat (stagiaire)1990-1992Castorama1993-1994Wordperfect1995Novell1996-1998Gan1998-1999Crédit agricoleÉquipes dirigées 2004-2008 France (sélectionneur)2012Team Type 1Principales victoires 2 étapes du Tour de Francemodifier - modifier le code - modifier…

Questa voce sull'argomento società calcistiche rumene è solo un abbozzo. Contribuisci a migliorarla secondo le convenzioni di Wikipedia. Fotbal Club Unirea DejCalcio Uniriștii (Gli unionisti) Segni distintiviUniformi di gara Casa Trasferta Colori socialiGiallo, blu, rosso Dati societariCittàDej Nazione Romania ConfederazioneUEFA Federazione FRF Campionatoliga II Fondazione1921 Presidente Gabriel Magdaș Allenatore Dragos Militaru StadioStadionul Unirea(6 000 posti) PalmarèsDa…

  هذه المقالة عن الرئيس بشارة خليل الخوري. لالشاعر بشارة عبد الله الخوري، طالع الأخطل الصغير. فخامة الرئيسالشيخ بشارة الخوري رئيس الجمهورية اللبنانية الأول في المنصب21 سبتمبر 1943 – 18 سبتمبر 1952 رئيس الوزراء رياض الصلحعبد الحميد كراميسامي الصلحسعدي المنلاحسين العوينيعبد…

Csézy im zweiten Halbfinale beim Eurovision Song Contest in Belgrad Csézy, mit vollen Namen Erzsébet Csézi (* 9. Oktober 1979 in Mezőkövesd), ist eine ungarische Sängerin. Inhaltsverzeichnis 1 Leben 2 Diskografie 2.1 Alben 2.2 Singles 3 Weblinks Leben Sie vertrat Ungarn beim Eurovision Song Contest 2008 in Belgrad, mit der Ballade Candlelight (ungarische Fassung Szívverés – Herzschlag). Im zweiten Halbfinale des ESC am 22. Mai 2008 gelang es ihr aber nicht, sich für das zwei Tage sp…

Florida is the largest producer of fresh-market tomatoes in the United States.[1][2] Season Harvest is almost year-round, from October to June.[1] The highest temperatures of the summer from July to September end profitable yield and even the heat of June and October limit productivity, such that April to May and November to January are the largest harvests of the year.[1] Federal Crop Insurance for fresh tomatoes specifically excludes insects and diseases.[3&…

2014 studio album by Garth BrooksMan Against MachineStudio album by Garth BrooksReleasedNovember 11, 2014 (2014-11-11)StudioAllentown Studios, NashvilleGenreCountry pop[1]pop rock[1]Length57:43LabelRCA NashvillePearlProducerMark MillerGarth Brooks chronology Blame It All on My Roots: Five Decades of Influences(2013) Man Against Machine(2014) The Ultimate Collection(2016) Singles from Man Against Machine People Loving PeopleReleased: September 3, 2014 MomRel…

1988 studio album by Jaki ByardBlues for SmokeStudio album by Jaki ByardReleased1988 (US)[1]RecordedDecember 16, 1960StudioNola Penthouse Studios, New York CityGenreJazzLength38:50LabelCandidCJS 9018ProducerAlan BatesJaki Byard chronology Blues for Smoke(1988) Here's Jaki(1961) Blues for Smoke is an album by pianist Jaki Byard recorded in 1960 and released on the Candid label.[2] Reception Professional ratingsReview scoresSourceRatingAllmusic[3]The Penguin Guide t…

Act of state entity involving restrictive political freedom of citizens Political repression is the act of a state entity controlling a citizenry by force for political reasons, particularly for the purpose of restricting or preventing the citizenry's ability to take part in the political life of a society, thereby reducing their standing among their fellow citizens.[1][2] Repression tactics target the citizenry who are most likely to challenge the political ideology of the state…

English, Scottish, Irish and Great Britain legislationActs of parliaments of states preceding the United Kingdom Of the Kingdom of EnglandRoyal statutes, etc. issued beforethe development of Parliament 1225–1267 1275–1307 1308–1325 Temp. incert. 1327–1376 1377–1397 1399–1411 1413–1421 1422–1460 1461 1463 1464 1467 1468 1472 1474 1477 1482 1483 1485–1503 1509–1535 1536 1539–1540 1541 1542 1543 1545 1546 1547 1548 1549      1551   …

This article does not cite any sources. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: Matariyyah – news · newspapers · books · scholar · JSTOR (June 2009) (Learn how and when to remove this message) Al-Matariyyah or Matariye, Mataria (Arabic: المطرية), is a village in South Lebanon near the Litani river. vte Sidon District, South GovernorateCapitalSidonTowns …

The location of the two Bailiwicks of Guernsey and Jersey (in red circle) form the Channel Islands in Europe Part of a series onJews and Judaism Etymology Who is a Jew? Religion God in Judaism (names) Principles of faith Mitzvot (613) Halakha Shabbat Holidays Prayer Tzedakah Land of Israel Brit Bar and bat mitzvah Marriage Bereavement Baal teshuva Philosophy Ethics Kabbalah Customs Rites Synagogue Rabbi Texts Tanakh Torah Nevi'im Ketuvim Talmud Mishnah Gemara Rabbinic Midrash…

Edible fruit cultivar For other uses, see Etrog (disambiguation). An Israeli etrog, with pitam and gartel (ridge around the center) Etrog (Hebrew: אֶתְרוֹג‎, plural: etrogim; Ashkenazi Hebrew: esrog, plural: esrogim) is the yellow citron or Citrus medica used by Jews during the week-long holiday of Sukkot as one of the four species. Together with the lulav, hadass, and aravah, the etrog is taken in hand and held or waved during specific portions of the holiday prayers. Special care…

Senegalese public broadcasting company This article is about the public broadcaster of Senegal. For the Slovenian broadcaster, see RTVSLO. For the Slovak broadcaster, see Radio and Television of Slovakia. For the Serbian Broadcaster, see Radio Television of Serbia.Radiodiffusion Télévision Sénégalaise (RTS)TypeBroadcast television networkCountrySenegalAvailabilityNational; internationalFounded1950 (radio), 1965 (television)MottoUne fenêtre dans le monde (A window in the world)Official websi…

Sasakᬲᬸᬓᬸᬲᬲᬓ᭄ سوكو ساساكJumlah populasi± 3.3 jutaDaerah dengan populasi signifikanNusa Tenggara Barat3.033.631Bali22.672Kalimantan Timur22.194Sulawesi Tengah20.436Kalimantan Selatan11.878Sulawesi Selatan11.335BahasaSasak/Lombok • IndonesiaAgamaMayoritas:Islam Sunni (termasuk Islam Tradisional yakni praktik Wetu Telu)Minoritas:Agama Tradisional (Boda)Kelompok etnik terkaitBali • Melayu • Jawa • Sumbawa/Samawa • Madura • Mbojo/Bima • Tolaki • Bugis • But…

Facundo de LeónNazionalità Uruguay Altezza177 cm Calcio RuoloCentrocampista Squadra Fénix CarrieraGiovanili 20??-2021 Bella Vista Squadre di club1 2021-2022 Bella Vista? (?)2023 Nacional6 (0)2024-→  Fénix5 (0) 1 I due numeri indicano le presenze e le reti segnate, per le sole partite di campionato.Il simbolo → indica un trasferimento in prestito. Statistiche aggiornate al 29 aprile 2024 Modifica dati su Wikidata · Manuale Facundo de León Abate (Mo…

Prison in Folsom, California, United States Folsom California State PrisonEast Gate, Folsom State Prison, at the end of Prison RoadLocationFolsom, California, U.S.Coordinates38°41′42″N 121°09′45″W / 38.69500°N 121.16250°W / 38.69500; -121.16250StatusOperationalSecurity classHigh SecurityCapacity2,065Population2,513 (121.7% capacity) (as of January 31, 2023[1])OpenedJuly 26, 1880; 143 years ago (1880-07-26)Managed byDr. Ms. Tracy J…

1984 video game 1984 video gameThe Dam BustersEuropean cover artDeveloper(s)Sydney DevelopmentPublisher(s)EU: U.S. GoldNA: AccoladeColeco (ColecoVision)Apollo Technica (NEC)Designer(s)J. Stewart EastbrookPlatform(s)Amstrad CPC, Apple II, ColecoVision, Commodore 64, MS-DOS, MSX, NEC PC-9801, ZX SpectrumRelease1984Genre(s)Air combat simulationMode(s)Single-player The Dam Busters is a combat flight simulation game set in World War II and published by U.S. Gold. It was released in 1984 for ColecoVis…

خريطة العالم وبها أراضي الولايات المتحدة باللون الأخضر تشمل أراضي الولايات المتحدة أي منطقة تقع ضمن نطاق الولاية السيادية لحكومة الولايات المتحدة الفيدرالية؛[1] بما في ذلك جميع المياه المحيطة بالجزر أو الأراضي القارية الأمريكية، والسفن التابعة للبحرية الأمريكية.[2 …