SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Constraint Violating Yak Guru

433 Posts

Posted - 08/21/2006 :  09:57:23  Show Profile  Reply with Quote
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 ')'

Patron Saint of Lost Yaks

30407 Posts

Posted - 08/21/2006 :  10:00:18  Show Profile  Visit SwePeso's Homepage  Reply with Quote
="INSERT TBLData (RE_ID, EMAIL) VALUES ('" & c2 & "', '" & d2 & "')"

Peter Larsson
Helsingborg, Sweden
Go to Top of Page

Constraint Violating Yak Guru

433 Posts

Posted - 08/21/2006 :  10:04:34  Show Profile  Reply with Quote
very good.
Go to Top of Page

Premature Yak Congratulator

22847 Posts

Posted - 08/21/2006 :  11:04:05  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
For every formula you need to start with = in EXCEL
Other approach


Failing to plan is Planning to fail
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000