I have an XLS file. Let's assume that it has 1000 rows in all, with 10 columns. I would like to import rows 5 through 995 (say), and columns 1 though 7 and 10. How can I do this using an SQL query, either though OPENROWSET or BULK INSERT? I am using SQL Server 2008.

Have you tried using the SQL Server Data Transformation Services (DTS) Import Wizard or the SQL Server Import and Export Wizard? Not sure if they will let you select columns/rows but it's worth a try.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.