Friday 11 July 2014

SQL Interview Questions


1.SetRowCount 5: it will return top 5 records only.
2.SetNoCount {ON;OFF}--- By default this will OFF, when ever we execute a SP it will show number of records updated(Effcted) while running that SP. If you set ON, it will not show effected records.
3.What is index in SQL? Advan and Disad...
4.Diff b/w Function and SP?
Ans)sp will return 2D out put but function will return only 1D.
5.Cursor, Trigger.
6.I have table in DB i want to update a record in that, if the Inserted value is more than with existing value other wise leave it as it is....
7.what is synonym in sql
8.Views and advantage of Views?
9.Temp table or Hash table
10. In the table i don't have any column related to SNO stil how can i show the row numbers in the Output (grid)
Select ROW_NUMBER() OVER ([]),[Column1],[Column2] from table