Question: I have a table `HRTC` in SQL Server. I want to import data which is in Excel into this table. But my Excel file does not have all the columns which match the `HRTC` table. Is there anyway I can do this?

I am thinking something like in the import wizard

```
Insert into SQLServerTable Select * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', 
'Excel 8.0;Database=D:\testing.xls;HDR=YES', 
'SELECT * FROM [SheetName$]')

 select column1, column2 from HRTC

```

Answer: 
One simple approach is to script your excel file into a collection of insert statement, then run it on SQL Server.

Also if you can export your excel file into CSV file, this is often useful. Tool like SQL Server Management Studio should have some kind of import wizard where you can load the CSV, choose column mapping etc.
What I often end up doing in these situations is to do some code completion using excel's CONCATENATE function.

Let's say you have:

```
     A     B
1  foo     bar
2  test2   bar2
3  test3   bar 3

```

If you needed to insert those into a table. In column C you can write:

```
=CONCATENATE("INSERT INTO HRTC(col, col2) VALUES('", A1, "','", B1, "')")

```