Wednesday, August 11, 2010

How to migrate data from Excel to SQL

1.)Write the following statement as below in a column in the excel you want to export

= "Insert into AppDbo.Recruit_FY11_DataForMapping(RecordActiveFlag,Address1,City,State,Country,[PhoneNumber],website,MSPPID,Tier,[PrimaryBDM],[AssignedDE],[PartnerCompanyName],[PostalCode],[SpinnakerID],[ISVEngagementStatus],[PartnerType1]) Values (1,'"&B2&"','"&C2&"','"&D2&"','"&F2&"','"&G2&"','"&H2&"',"&I2&",'"&M2&"','"&O2&"','"&P2&"','"&A2&"','"&E2&"','"&K2&"','"&Q2&"','"&N2&"')"

2.)Select enter and then double click the + sign that comes and the query is replicated in the corresponding cells incrementing the cells value by corresponding cells.

3.)Copy paste the column values and out it in the query.sql and run it.

No comments:

Post a Comment