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.
相关问题
- SQL to Parse a Key-Value String
- How to evaluate an input in the WHERE clause
- employee id automatic generate with prefix
- update user details, sql server 2008 sqlsrv
- Calculating the 95th Percentile value?
相关文章
- Code for inserting data into SQL Server database u
- SQL Server 2008 Change Data Capture, who made the
- How do we alias a Sql Server instance name used in
- How to do a UNION on a single table?
- SQL Group by Count of Counts
- SQL Server drop and recreate indexes of a table
- How to generate sequential row number in tsql?
- Pass table as parameter to SQLCLR TV-UDF
I would approach this in a slightly different way.
I would import all the data into the database, into a temporary table. Then I would query that table, extracting the information that's needed.
Alternatively, you could look at a SSIS process to do this.
I had another idea.
You could also use a Linked Server which connects to the Excel document.
(This is probably an easier approach for you.)
See: http://support.microsoft.com/kb/306397