Import Excel Sheet in to Sql Server database

Posted by Ksuresh under Sql Server on 9/21/2012 | Points: 10 | Views : 9800 | Status : [Member] | Replies : 9
Hi All,

I have one Excel Sheet with data , i want it like a table in Database Sql Server, Here mainly How to import Excel Sheet Sql Server in Godaddy.com Where we hosted our website ,So please any one can help me in this.

Regards
Suresh




Responses

Posted by: Vasanthmvp on: 9/21/2012 [Member] Starter | Points: 25

Up
0
Down
Hi Suresh,
the latest article links here below will help you:
They are described well with an example,

http://stackoverflow.com/questions/375991/import-excel-spreadsheet-columns-into-sql-server-database
http://www.dotnetfunda.com/articles/article1954-how-to-read-ms-excel-file-and-populate-into-gridview.aspx
http://support.microsoft.com/kb/321686

Regards,

Awesome Coding !! :)

Ksuresh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Hariinakoti on: 9/21/2012 [Member] Starter | Points: 25

Up
0
Down
Hi suresh,
see this link
http://support.microsoft.com/kb/321686

Thanks & Regards
Hari

Ksuresh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Hariinakoti on: 9/21/2012 [Member] Starter | Points: 25

Up
0
Down
see this link also
http://www.codeproject.com/Articles/32581/Import-Data-from-Excel-to-SQL-Server

Thanks & Regards
Hari

Ksuresh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Hariinakoti on: 9/21/2012 [Member] Starter | Points: 25

Up
0
Down
Please Mark as Answer .If satisfy with my answer

Thanks & Regards
Hari

Ksuresh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Muhsinathk on: 9/21/2012 [Member] Bronze | Points: 25

Up
0
Down
Please try these steps..


1)Open SQL Server Enterprise Manager
2)Right-click on the appropriate server
3) Select Import Data
4)Run through the wizard.
a) Click Next on the first screen
b)Choose "Microsoft Excel " as your datasource
c) Enter the path to the XLS file and click next.
d)Enter the connection details for your database and click next.


Ksuresh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Muhsinathk on: 9/21/2012 [Member] Bronze | Points: 25

Up
0
Down
Please try these too..

OPENROWSET or OPENDATASOURCE will be the easiest way, without the wizard. (see Distributed Queries)

SELECT * INTO XLImport4 FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:\test\xltest.xls', [Customers$])

Ksuresh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Muhsinathk on: 9/21/2012 [Member] Bronze | Points: 25

Up
0
Down
Mark as answer if it helpful to u..That helps others who search the same..

Ksuresh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Muhsinathk on: 9/21/2012 [Member] Bronze | Points: 25

Up
0
Down
Please try these too..

1. Enter the data into an Excel spreadsheet

1) First, enter the data into an Excel spreadsheet.
2. Start the SQL Import and Export Wizard

1) Next, in Windows, start the Import and Export Wizard at Start / All Programs / Microsoft SQL Server 2008/ Import and Export Data.
The Welcome page appears. Click Next.

3. Chose your Excel spreadsheet as the Data Source

1) In the Data Source dropdown of the Choose a Data Source page, select Microsoft Excel.
2) In the Excel file path box, specify the file path to the Excel spreadsheet.
3) Select the the version in the Excel version dropdown.
4) Make sure that First row has column names is checked.
5)Click Next.
4. Chose your SQL database as the destination

1) In the Destination dropdown list, accept the default setting of SQL Server Native Client 10.0.
2)In the Server name dropdown list, enter the name of the server. The example is a remote server, so the IP address and port of the server were specified.
3) Chose the Authentication type. The example is a remote server, so SQL Server authentication, with a user name and password, is required.
4) In the Database dropdown list, select or type the name of the database.
5)Click Next.

5. Specify how to copy the data

1)The default option, Copy data from one or more tables or views, works for this example.
2) If you want to try the second option, Write a query to specify the data to transfer, the following lolcode snippet may be instructive:

CAN HAS SQL?
DBASE IZ GETDB('db/demo.db')
FUNNAHS IZ DBUCKET(&DBASE&,"CAN I PLZ GET * ALL UP IN lollit")
IM IN UR FUNNAHS ITZA TITLE
VOTEZ IZ &TITLE#ups& - &TITLE#downs&

3)Click Next.
6. Select the source tables and views

1) The default settings as shown work in this example.
2) In the Destination column, you can specify a different name for the table in the SQL database if you choose.
3)Click Preview to see how your data will appear in the destination table.
4)You can click Edit Mappings to change how your data is assigned at the destination table, but it shouldn't be necessary in this example since you entered the data into the Excel spreadsheet yourself.
5)Click Next.
7. Run the "Package"

1)Click next

8. Verify that the package executed successfuly

1)Click Report to view useful information about the data transfer process.
2)Click Close.

9. View the new table in SQL Server Management Studio

1) View your new table by opening Microsoft SQL Server 2008 Management Studio at Start / All Programs / Microsoft SQL Server 2008/ Import and Export Data.


if u have any problem please refer this link

http://www.66pacific.com/sql_server_import_from_excel.aspx






Ksuresh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ksuresh on: 9/21/2012 [Member] Starter | Points: 25

Up
0
Down
Hi All,

Thanks for Information, I done with this process in Local machine But My requirement is Now i want same excel sheet to import in to Sql Server in "Godaddy.com".
Our website host is Godaddy So they provide Sql Server also in that i had created a Database now i want to import Excl Sheet in to that Database. The above all Process provide for import excel sheet are not working there. There must different for this. That's what i need.

Regards
Suresh

Ksuresh, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response