Insert csv rows to sql

So, I’ve been searching how can I upload csv rows to sql database, I found the following topic (Insert csv rows to database) but it’s throwing an error at the end (step 8)
Error: Execute Non Query: Object reference not set to an instance of an object.