The original text uses TOP to limit updated data
You can use the TOP clause to limit the number of rows modified in the UPDATE statement. When the TOP (N) clause is used with UPDATE, the delete operation is performed on the randomly selected n rows. For example, suppose you want to reduce the sales burden for a senior salesperson and assign some customers to a junior sales person. The following example assigns a randomly sampled 10 customers from one salesperson to another.
Transact-SQL:
TOP (Ten) Sales.storeset SalesPersonID = 276WHERE SalesPersonID = 275; GO
If you need to use top to apply updates arranged in a meaningful chronological order, you must use both the top and order BY clauses. The following example updates the number of vacation hours for the first 10 employees hired.
Transact-SQL
HumanResources (SELECT TOP BusinessEntityID from HumanResources.Employee ORDER by HireDate ASC)th HumanResources.Employee. BusinessEntityID = th. BusinessEntityID; GO
Gmt
|
Detection languageWorld languageChinese SimplifiedChinese TraditionalDanishUkrainianUzbek languageUrdu languageArmenianIgbo languageRussianBulgarianSinhala languageCroatianIcelandicGalicianCatalanHungarianZulu, South AfricaKannada languageHindiIndonesian SundaIndonesian JavaneseIndonesian languageGujaratiKazakhTurkishTajik languageSerbian languageSesotho languageWelshBengaliCebu languageNepalese languageBasque languageBoolean language (Afrikaans)HebrewGreekGermanItalianYiddishLatin languageLatvianNorwegianCzechSlovakSlovenianSwahiliPunjabiJapaneseGeorgian languageMaoriFrenchPolishBosnianPersianTeluguTamilThaiHaitian CreoleIrishEstonianSwedishBelarusian languageLithuanianSomalia languageYorubaBurmese languageRomanian languageLao languageFinnishHmongEnglishDutchFilipinoPortugueseMongolianSpanishHausa languageVietnameseAzerbaijani languageAlbanianArabicKoreanFYRO MacedonianMalagasy languageMarathiMalayalamMalayMalteseKhmer languageChichewa language |
|
World languageChinese SimplifiedChinese TraditionalDanishUkrainianUzbek languageUrdu languageArmenianIgbo languageRussianBulgarianSinhala languageCroatianIcelandicGalicianCatalanHungarianZulu, South AfricaKannada languageHindiIndonesian SundaIndonesian JavaneseIndonesian languageGujaratiKazakhTurkishTajik languageSerbian languageSesotho languageWelshBengaliCebu languageNepalese languageBasque languageBoolean language (Afrikaans)HebrewGreekGermanItalianYiddishLatin languageLatvianNorwegianCzechSlovakSlovenianSwahiliPunjabiJapaneseGeorgian languageMaoriFrenchPolishBosnianPersianTeluguTamilThaiHaitian CreoleIrishEstonianSwedishBelarusian languageLithuanianSomalia languageYorubaBurmese languageRomanian languageLao languageFinnishHmongEnglishDutchFilipinoPortugueseMongolianSpanishHausa languageVietnameseAzerbaijani languageAlbanianArabicKoreanFYRO MacedonianMalagasy languageMarathiMalayalamMalayMalteseKhmer languageChichewa language |
|
|
|
|
|
Text-to-speech feature is limited to 200 characters
|
|
Options: History: Feedback: Donate |
Shut down |
SQL Server Update: Use TOP to limit updated data