Tuesday, July 24, 2012

How to insert records from *.csv file to sql server 2005

sp_configure

sp_configure 'show advanced options', 1
reconfigure

sp_configure 'Ad Hoc Distributed Queries', 1

select * from [Customers_A-F]

insert into [Customers_A-F]
SELECT * FROM OPENROWSET('MICROSOFT.JET.OLEDB.4.0','Text;Database=D:\Temp\;','SELECT * FROM [Customers.csv]')

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)

Monday, November 29, 2010

UML Tutorial

http://www.tutorialspoint.com/uml/
http://atlas.kennesaw.edu/~dbraun/csis4650/A&D/UML_tutorial/

Sunday, November 21, 2010

.Net framework Interview Questions

http://www.andymcm.com/dotnetfaq.htm#13.5
http://www.andymcm.com/dotnetfaq.htm
http://www.andymcm.com/csharpfaq.htm#3.7
Anonymous Methods in C# 2.0
http://www.c-sharpcorner.com/UploadFile/DipalChoksi/anonmethod_cs20_dc09192006162337PM/anonmethod_cs20_dc.aspx

Are C# parameters passed by reference or by value?
All parameters are passed by value by default in C#. However, know that when passing a reference type, a reference is being passed—by value—rather than an object itself. The Java language works in the same way.