Reputation: 29659
I have a stored procedure that imports differently formatted workbooks into a database table, does work on them then drops the table.
Here is the populating query.
SELECT IDENTITY(INT,1,1) AS ID
INTO #test101
FROM OPENROWSET
('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=WorkBook.xls',[WorkSheet$])
Some spreadsheets seem to create an null row in the bottom.
How can I import and ignore the null rows?
Upvotes: 1
Views: 4145
Reputation: 22187
DELETE FROM #test101 WHERE myCol_1 IS NULL AND myCol_2 IS NULL
Upvotes: 3