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, 2187🔥, 0💬
Popular Posts:
How To Insert New Line Characters into Strings in SQL Server Transact-SQL? If you want to break a st...
How To Convert Binary Strings into Hexadecimal Character Strings in SQL Server? When a query returns...
How to put statements into a statement block in SQL Server Transact-SQL? You can put statements into...
How To Use DATEADD() Function in SQL Server Transact-SQL? DATEADD() is a very useful function for ma...
What Is "mysqld" in MySQL? "mysqld" is MySQL server daemon program which runs quietly in background ...