Results 1 to 3 of 3
  1. #1
    Join Date
    May 2009
    Posts
    2

    Unanswered: Remove spaces in column content in sql

    Hi,
    I have problem after exporting excel data to sql server. I got spaces in columns content. I can remove the spaces single column content at a time using Trim() function.But I need to remove spaces in all columns content at a time.Is there any possiblity to remove spaces in all columns content at a time? Please provide solution.

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Yup - use Trim() on each column.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Jun 2004
    Location
    Long Island
    Posts
    696
    Quote Originally Posted by Saranram
    Hi,
    I have problem after exporting excel data to sql server. I got spaces in columns content. I can remove the spaces single column content at a time using Trim() function.But I need to remove spaces in all columns content at a time.Is there any possiblity to remove spaces in all columns content at a time? Please provide solution.
    I typically save the file as a .csv file, avoid the Excel headache of calculated cells, etc. I have instances importing a native .xls where they sometimes come in as null (with DTS). If you need to do this dynamically, there are tools out there where you can convert .xls (even with multiple worksheets) to .csv via a command line script, works great for me, and better yet, you don't even need DTS/SSIS to import a csv file, you can simply use OpenRowset to import the csv file to a table.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •