Stored procedure practices in SQL Server
Learn how to debug stored procedures, call a stored procedure from functions and duplicate values in a table with this SQL Server expert's advice.
How can I call a stored procedure from functions?
Continue Reading This Article
Enjoy this article as well as all of our content, including E-Guides, news, tips and more.
How can I find duplicate values in a table?
There are several ways to delete duplicate rows from a table. This is the easiest way of de-duplicating a table, and is at its best with fairly small rowsets, and where all the columns in a table are duplicates. We simply run a SELECT DISTINCT on the offending table, storing the results in a temporary table, then delete the contents of the permanent table and re-populate it from the temporary one. While this may be the simplest way, you may have some space issue if you are working with millions of rows. Derived tables and correlated subqueries can also be used.
Dig Deeper on SQL Server Stored Procedures
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.
Meet all of our SQL Server experts
View all SQL Server questions and answers
Start the conversation
0 comments