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

Author  Topic 

collie
Constraint Violating Yak Guru

400 Posts

Posted - 2007-05-06 : 02:55:11
Hi,

I have a table in sql server 2000. I need to add to that table rows from an excel document. The excel document contains columns that i don't need and data that i don't need so i need to only select the columns that i need and also the conditions that i need such as where system="Gilb"

how do i do that?

thanks

blindman
Master Smack Fu Yak Hacker

2365 Posts

Posted - 2007-05-06 : 10:04:22
Use a DTS package.

e4 d5 xd5 Nf6
Go to Top of Page

collie
Constraint Violating Yak Guru

400 Posts

Posted - 2007-05-06 : 15:08:41
hi,

isn't there a way of doing it in sql query analyser?

thanks
Go to Top of Page

blindman
Master Smack Fu Yak Hacker

2365 Posts

Posted - 2007-05-07 : 00:49:32
Not in Excel format, that I know of. You would need to export it from Excel to a delimited or fixed-width format.

You may also be able to use Excel macros or modules to export the data from your spreadsheet to your database, but that is an Excel/VB issue and not an SQL issue.

e4 d5 xd5 Nf6
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-05-07 : 04:44:22
Refer this
http://sqlteam.com/forums/topic.asp?TOPIC_ID=49926

Madhivanan

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

blindman
Master Smack Fu Yak Hacker

2365 Posts

Posted - 2007-05-07 : 10:07:19
Ah. I forgot about OPENROWSET. Rarely use it...

e4 d5 xd5 Nf6
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-05-07 : 10:49:38
quote:
Originally posted by blindman

Ah. I forgot about OPENROWSET. Rarely use it...

e4 d5 xd5 Nf6


Yes rarely used but sometimes really helpful.
Now-a-days, users want to do that in query and thats the reason I think my thread is being viewed many times a day

Madhivanan

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

sshelper
Posting Yak Master

216 Posts

Posted - 2007-05-07 : 11:10:33
Here are a few links that may also be able to help:

http://www.sql-server-helper.com/tips/read-import-excel-file-p01.aspx
http://www.sql-server-helper.com/tips/read-import-excel-file-p02.aspx
http://www.sql-server-helper.com/tips/read-import-excel-file-p03.aspx

SQL Server Helper
http://www.sql-server-helper.com
Go to Top of Page

blindman
Master Smack Fu Yak Hacker

2365 Posts

Posted - 2007-05-07 : 11:42:42
The irony is not lost on me...
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=83190



e4 d5 xd5 Nf6
Go to Top of Page
   

- Advertisement -