Here I will explain how to use top clause or keyword with update and delete statements in SQL Server.
Column Name
|
Data Type
|
Allow Nulls
|
UserId
|
Int
(set Identity=true)
|
No
|
UserName
|
varchar(50)
|
Yes
|
Location
|
Varchar(50)
|
Yes
|
UPDATE TOP(N) Table1 SET Column1='somevalue'
|
UPDATE TOP(2) UserInformation
SET UserName='test2'
|
DELETE TOP(N) FROM Table1
|
DELETE TOP(2) FROm UserInformation
|
|
If you enjoyed this post, please support the blog below. It's FREE! Get the latest Asp.net, C#.net, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email. |
|||
Subscribe by RSS
Subscribe by Email
|
|||
|
|



Subscribe by RSS
Subscribe by Email
0 comments :