Import from CSV to SQL Table

As Technet Gallery is retiring so moving the code to Git Hub. (click below github download link for this script)

Import from CSV to SQL Table

 

Hi All,

Sharing a Powershell method to import CSV to sql table, I am attaching the example CSV as well.

First step is to create the Header in SQL table same as in CSV that needs to be Imported.

I am sharing the example that I have followed for demonstration of this script:

  • Created the Test Database by logging in to SQL management studio

Capture

Capture

Capture

Tech Wizard

https://techwizard.cloud

https://syscloudpro.com/

PowerShell Cheat Book

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s