in tabase table having a column in it empname field is
there which having 5 duplicate values is there i want
deleted all the duplicates i want showing only one name
only.

Answer Posted / venkat

Hope this methodology would help you better

1.Create a temp table
2.Select duplicated row's empid,empname into the temp table.
3.Create a cursor by selecting values from temp table.
4.Keep either min or max(empid) from original table and
delete the rest of the duplicated rows.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the different Topologies in which Replication can be configured?

856


How to locate and take substrings with charindex() and substring() functions?

697


Your sql server is running out of disk space. You notice that there are several large files with ldf extensions what are these files?

806


How to enter binary string literals in ms sql server?

820


What is primary key index?

704






Explain the steps to create and execute a user-defined function in the sql server?

708


What are window functions in sql server?

686


What are the source of constraints?

664


Can you roll back the ddl statement in a trigger?

695


Can I run multiple instances of sql server 2000 at the same time on one computer?

797


Explain Capacity planning to create a database? and how to monitor it?

3947


What is sql server profiler trace data file?

783


What are recommended options to be used while using db mirroring? : sql server database administration

759


Explain the rules for designing files and file groups in sql server?

708


Explain DBCC?

733