Thursday, December 16, 2010

Friday, December 10, 2010

SQL Server 2005 Shortcut Keys

SQL Server 2005 Shortcut Keys

Below I am giving generally used shortcut keys in SQL Server 2005 :

* Cancel a query. ALT+BREAK
* Connections: Connect. CTRL+O
* Connections: Disconnect. CTRL+F4
* Connections: Disconnect and close child window. CTRL+F4
* Database object information. ALT+F1 (i.e Structure Of Table etc. ) Equivalent to sp_help)
* Editing: Clear the active Editor pane. CTRL+SHIFT+DEL
* Editing: Comment out code. CTRL+SHIFT+C
* Editing: Decrease indent. SHIFT+TAB
* Editing: Increase indent. TAB
* Editing: Delete through the end of a line in the Editor CTRL+DEL
* Editing: Find. CTRL+F
* Editing: Go to a line number. CTRL+G
* Editing: Make selection lowercase. CTRL+SHIFT+L
* Editing: Make selection uppercase. CTRL+SHIFT+U
* Editing: Remove comments. CTRL+SHIFT+R
* Editing: Replace. CTRL+H
* Execute a query. CTRL+E , F5
* Help for the selected TSQL statement. SHIFT+F1
* Navigation: Switch between query and result panes. F6
* Navigation: Switch panes. Shift+F6
* New Query window. CTRL+N
* Object Browser (To show/hide). F8
* Object Search. F4
* Parse the query for checking syntax. CTRL+F5
* Print. CTRL+P
* Results: Display results in grid format. CTRL+D
* Results: Display results in text format. CTRL+T
* Results: Save results to file. CTRL+SHIFT+F
* Results: Show Results pane (toggle). CTRL+R
* Save. CTRL+S
* Tuning: Index Tuning Wizard. CTRL+I
* Change / Select Database. CTRL+U

Sunday, December 5, 2010

get top 7 salary

select min(salary) from tblSalary where salary in(
select distinct top 7 salary from tblSalary order by salary desc)