Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6901647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:41:58+00:00 2026-05-27T07:41:58+00:00

Hello everybody I have some certs in SQL 2008 but am by no means

  • 0

Hello everybody I have some certs in SQL 2008 but am by no means a master. I was curious if my goal was to query a CSV or Excel file on my desktop within SSMS how to do this? BEFORE anyone mentions Openrowset and turning it on through sp_configure I have tried that and it seems to not working when trying ‘Microsoft.Jet.OLEDB.4.0’ driver, the ‘MSADSAL’ drivers or the other iterations of it. It gives some error about the server not being allowed to be null OR else that this is only able to run in Single threaded mode. I read up on this and a lot of people claim that you have to run a 32 bit version or similar to get it. What confuses me is I can use the ‘BULK’ method with Openrowset and then select the ‘Single_Clob’ however I get a comma seperated string which I would then have to parse out.

What my real question is, is there a simple way to just query a CSV or Excel file fast in a 64 bit version of SSMS 2008 R2?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T07:41:59+00:00Added an answer on May 27, 2026 at 7:41 am

    Figured it out:

    Approach A: bcp:

    1. Ensure that xp_cmdshell is on. (If you are on production environment for an enterprise company this MAY not be an option for security reasons. You may always use a BETA or QA environment to put the data to first and hopefully have linked servers set up).

      exec sp_configure ‘xp_cmdshell’, 1
      reconfigure

    2. Create a csv file for testing purposes. I did a three column csv flat file as such:

    A, Brett, 1
    B, John, 2
    C, Brian, 3

    1. Create a temp or permanent table matching the data types shown here:

      create table Test ( value varchar(3), Name varchar(16), ID int)

    2. Run bcp from the command shell ensuring you do not have the file open.

      EXEC xp_cmdshell ‘bcp Test..Test in “C:\test\Test.txt” -c -t , -r \n -T’
      GO

    if you are curious on switches with bcp, use the help file: EXEC xp_cmdshell ‘bcp /?’
    ! For myself I had this method work in SQL 2005 and FAIL in SQL 2008 and 2008 R2 with this exception: Error = [Microsoft][SQL Native Client]Unexpected EOF encountered in BCP data-file. I looked and looked and looked but it appears that my file in standard UTF format with the standard comma delimeter and the standard \n line feed SQL bcp does not like. However my next solution worked right away.

    Approach B: Bulk Insert:

    1. Follow steps 2 and 3 above the same

    2. Run Bulk Insert as such:

      BULK INSERT dbo.Test
      FROM ‘C:\test\Test.csv’
      WITH (FIELDTERMINATOR = ‘,’, ROWTERMINATOR = ‘\n’)

    As long as your table data types match the import, you should be fine. Ulimtately a simple table creation and a three line statement to me is pretty quick compared to having to run a wizard constantly or open up Business Intelligence Development Studio at which point I might as well just a write a custom C# app.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello everybody! I have a SQL (see above) and i would like to know
Hello everybody Well my question is about sql commands... If I have 2 tables
Hello everybody and thanks for interest some time ago i have started to use
Lets say I have some code: <?php echo Hello Everybody!; echo <br/> ; $var1
Hello everybody I have a LINQ declaration like this : var query = from
Note: Using Monotouch and doing all the UI Programatically. Hello everybody, I have a
Hello everybody I have this string: [JOLLY BLU at STAY SHIP, Voy: 0275/11] How
Hello everybody I have a question: I have a array String[] parte and I
Suppose I have String str=Hello $everybody$. How $are$ you $all$; From above string, I
Everybody, Hello! I have a simple stub client for the cxf web-service (spring app).

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.