Assume I have an Excel document with a single sheet in it. Where there is data in columns A-G, I can select all of them simply by using "SELECT * FROM [" + sheetname + "]"
. However, what if I want to specify columns? If there only happens to be a small number of columns, I would do the same as I would in SQL: SELECT x, y, z FROM...
. If I want, however, to select a large number of specific columns, is there a way to do this in bulk? Additionally, if the first specific column is the first column in the sheet, is it possible to select the first x number of columns simply?
I'm looking to significantly shorten the T-SQL string here.