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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 excel

Author  Topic 

fmardani
Constraint Violating Yak Guru

433 Posts

Posted - 2006-08-21 : 09:57:23
Hi,
I have been given an excel spreadsheet with two columns with data.
There are about 20 records in this excel sheet.
Would like to write an insert query to insert these data.
I am thinking of writing an insert query for the first line iin the excel sheet and then drag it down to the last row of data so that it automatically writes the values of the columns in the insert query and i just copy and paste the script into sql to run.
This is what I have but the values of the cells do not get reflected.
Any thoughts pls?
'insert into TBLData (RE_ID, EMAIL) values (' & c2 & ',' & d2 ')'

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-08-21 : 10:00:18
="INSERT TBLData (RE_ID, EMAIL) VALUES ('" & c2 & "', '" & d2 & "')"

Peter Larsson
Helsingborg, Sweden
Go to Top of Page

fmardani
Constraint Violating Yak Guru

433 Posts

Posted - 2006-08-21 : 10:04:34
very good.
Thanks
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-08-21 : 11:04:05
For every formula you need to start with = in EXCEL
Other approach
http://sqlteam.com/forums/topic.asp?TOPIC_ID=49926

Madhivanan

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

- Advertisement -