Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 excel to sql

Author  Topic 

kashyap_sql
Posting Yak Master

174 Posts

Posted - 2010-07-23 : 02:07:53
I have a table in excel sheet i want to convert the excel sheet to the Db created by me i,e. appartments the excel is saved as tdetails
kindly help me

Kashyap M

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2010-07-23 : 02:11:11
take a look at this thread
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=49926


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

kashyap_sql
Posting Yak Master

174 Posts

Posted - 2010-07-23 : 03:09:18
i had checked the link but unable to find a solution but i did one thing that is directly copying the data into table from the sheet is this ok or not

Kashyap M
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-07-23 : 03:43:31
quote:
Originally posted by kashyap_sql

i had checked the link but unable to find a solution but i did one thing that is directly copying the data into table from the sheet is this ok or not

Kashyap M


What is the difficulty you had?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

kashyap_sql
Posting Yak Master

174 Posts

Posted - 2010-07-23 : 03:47:47
i had copied directly from the excel sheet. but this is not fare to me i want to know some thing through coding but i am a new bee unable to understand the link so.i had tried this
 SELECT * INTO Tenantdetails
FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=d:\Tdetails.xls', 'SELECT * FROM [Tdetails$]')

but being a user i am unable to survive the server blocks me

Kashyap M
Go to Top of Page

kashyap_sql
Posting Yak Master

174 Posts

Posted - 2010-07-23 : 04:00:04
Msg 15281, Level 16, State 1, Line 1
SQL Server blocked access to STATEMENT 'OpenRowset/OpenDatasource' of component 'Ad Hoc Distributed Queries' because this component is turned off as part of the security configuration for this server. A system administrator can enable the use of 'Ad Hoc Distributed Queries' by using sp_configure. For more information about enabling 'Ad Hoc Distributed Queries', see "Surface Area Configuration" in SQL Server Books Online.
this is the error i get

Kashyap M
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-07-23 : 06:01:53
Are you doing the export often or is it a one time job?
If it is one time job, you can copy the result and paste in the excel file

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-07-23 : 06:10:10
No - he wants the other way - from Excel to SQL table .
He is using Execl as an application to type in the data that is needed in a SQL table.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

kashyap_sql
Posting Yak Master

174 Posts

Posted - 2010-07-23 : 06:14:25
quote:
Originally posted by webfred

No - he wants the other way - from Excel to SQL table .
He is using Execl as an application to type in the data that is needed in a SQL table.


No, you're never too old to Yak'n'Roll if you're too young to die.


yes i want as you said excel to sql server

Kashyap M
Go to Top of Page
   

- Advertisement -