Collections:
Deleting an Existing Row with DELETE Statements in SQL Server
How To Delete an Existing Row with DELETE Statements in SQL Server?
✍: FYIcenter.com
If you want to delete an existing row from a table, you can use the DELETE statement with a WHERE clause to identify that row. Here is good sample of DELETE statements:
-- insert a row for this test
INSERT INTO fyi_links (url, id)
VALUES ('www.myspace.com', 301)
GO
(1 row(s) affected)
-- view the inserted row
SELECT id, url, notes, counts FROM fyi_links
WHERE id = 301
GO
id url notes counts
301 www.myspace.com NULL NULL
-- delete one row
DELETE FROM fyi_links WHERE id = 301
GO
(1 row(s) affected)
-- try to view the deleted row
SELECT id, url, notes, counts FROM fyi_links
WHERE id = 301
no rows
Row with id of 301 is truly deleted.
⇒ Deleting Multiple Rows with One DELETE Statement in SQL Server
⇐ UPDATE Subquery Returning Multiple Rows in SQL Server
2016-10-30, 2199🔥, 0💬
Popular Posts:
How To Convert Numeric Values to Character Strings in MySQL? You can convert numeric values to chara...
What is sqlservr.exe - Process - SQL Server (SQLEX?PRESS) in SQL Server? Process sqlservr.exe is the...
How to execute statements in loops in SQL Server Transact-SQL? How to use WHILE ... loops? You can u...
How To Drop an Index in Oracle? If you don't need an existing index any more, you should delete it w...
What is test testing area for? The testing area is provided to allow visitors to post testing commen...