Import data from an Excel file to SQL Server


Many ways to do it and here is one:

  1. Create a Linked Server in the SQL Server that corresponds to the excel file.
      1. The properties assigned to the Linked Server:

    image

    2. Enable adhoc distributed queries (be careful with this! It has security implications!)
    3. SELECT * INTO [Table_Name] FROM EXCELDATA…[Sheet1$]
Advertisements

One thought on “Import data from an Excel file to SQL Server

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