Home
|
Tutorial
|
Articles
|
Forum
|
Interview Question
|
Code Snippets
|
News
|
Fun Zone
|
Poll
|
Web Links
|
Certification
|
Search
Welcome :
Guest
Sign In
Register
Win Surprise Gifts!!!
Congratulations!!!
Top 5 Contributors of the Month
Jean Paul
satyapriyanayak
Narayanan
Karthikeyan Anbarasan
JQuery Developer
Home
>>
Interview Question
>>
Sql Server
>>
Post New Question
Subscribe to Interview Questions
Deleting Duplicates rows from the table?
Posted By :
Mallikarjuna Chigicherla
Posted Date :
August 04, 2010
Points :
10
Category :
Sql Server
delete from Employee where(EmpId Not In(Select Max(EmpId) from Employee Group By EmpName
-------------------------------
Note: EmpId Should Be identity column means Autogenerated column
You can also find related Interview Question to
Deleting Duplicates rows from the table?
below:
Database: State whether a view can be used for updating or deleting rows from table on which it is created?
Yes, view can update or delete from underlying tables.
(More...)
Which type of index physically orders the rows in a table?
Clustered index
(More...)
How many ways return rows from one table not in another table?
There are at least 5 ways to return data from one table which is not in another table. Two of these are SQL Server 2005 and greater only
1)NOT IN
2)NOT EXISTS
3)LEFT and RIGHT JOIN
4)OUTER APPLY (2005+)
5)EXCEPT (2005+)
(More...)
How do you display only few # of rows from any table?
Top Clause
(More...)
What are the privileges that can be granted on a table by a user to others?
Insert, update, delete, select, references, index, execute, alter, all
(More...)
Which system table contains information on constraints on all the tables created?
USER_CONSTRAINTS
(More...)
What command is used to create a table by copying the structure of another table?
CREATE TABLE .. AS SELECT command
Explanation :
To copy only the structure, the WHERE clause of the SELECT command should contain a FALSE statement as in the following.
CREATE TABLE NEWTABLE AS SELECT * FROM EXISTINGTABLE WHERE 1=2;
If the WHERE condition is true, then all the rows or rows satisfying the condition will be copied to the new table.
(More...)
How to clear all rows of the GridView?
make DataSource as null.
GridView1.DataSource = null;
(More...)
How to get a row was inserted most recently in a table?
select top 1 * from tablename order by ColumnName desc
(More...)
How To Update Description Value for a Column in Table using SQL Command?
We can Update Description to Column using sp_updateextendedproperty System Store Procedure.
Sample Command to Update Description for Column in a Table:
EXEC sys.sp_updateextendedproperty @name=N'MS_Description', @value=N'My Description for Column Here' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MyTableName', @level2type=N'COLUMN',@level2name=N'ColumnName'
(More...)
Quick Links For Interview Questions Categories:
ASP.Net
Windows Application
.NET Framework
C#
VB.Net
ADO.Net
Sql Server
SharePoint
Silverlight
OOPs
JQuery
JavaScript/VBScript
Biztalk
Patten/Practices
.IIS
WCF
WPF
WWF
Networking
Aptitude
Others
All
Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.
So, Start looking our
Interview Question
section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.
Hall of Fame
Twitter
Terms of Service
Privacy Policy
Contact Us
Archives
Tell A Friend