That's not really a SQL Server problem, that's how Excel works.
Once you touch a cell Excel think you entered it and on import you get that rows as well.
Delete the unwanted rows after import.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
HI,
Here I am trying to import excel data to sql table. But I could see that Based on the no of rows present in the Database table, It is providing as much null values.
If suppose, I am having the table name Car in DB. If I try to import Data to the same Table where I have the Additional Data in the excel file and it Consists of only 5 rows. I Could see that after importing, there are 18 rows total and where 4 rows consisting full of Null values.
How to avoid this when importing itself.
Please Help me out. Thanks.
That's not really a SQL Server problem, that's how Excel works.
Once you touch a cell Excel think you entered it and on import you get that rows as well.
Delete the unwanted rows after import.
Are you using SSIS to load the data to the table?
If yes, you may use sql command when using excel source to load data, and the you can remove the null values.
select Id,name from [sheetname$]
where Id is not null
Or you may use Conditional Split, check here.
Regards,
Zoe
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.