How to remove quotes from incoming data

bk 461 Reputation points
2021-03-16T20:36:21.823+00:00

Hi All,
I am loading data from one Staging table SQL Server into a production Table SQL Server. There are 75 columns and all the columns are in quotes "". How can i remove these quotes. I tried REPLACE([AssetDescr], "\"","in")" and it did not work.
Please advice.
Thanks

SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,523 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,598 questions
{count} votes

1 answer

Sort by: Most helpful
  1. MelissaMa-MSFT 24,186 Reputation points
    2021-03-17T02:44:30.783+00:00

    Hi @bk ,

    Welcome to Microsoft Q&A!

    If your issue is TSQL related, please refer below example and check whether it is helpful.

    create table #t  
    (  
    Name varchar(100)  
    )  
      
    insert into #t(Name)values('"abcd"')  
      
    --Remove all quote:  
    update #t   
    Set Name = REPLACE(Name, '"', '')  
    WHERE CHARINDEX('"', Name) <> 0  
    
    --or  
    UPDATE #t  
    SET Name = REPLACE(Name, CHAR(34), '')  
    WHERE CHARINDEX('"', Name) <> 0  
      
    Select * from #t  
    drop table #t  
    

    If your issue is related with SSIS and you would like to remove the quote from the import flat file, you could refer below:

    To set the Text qualifier to " (double quote) in the Flat File Connection manager.

    78489-qualifier.jpg

    If both of above are not working, please provide more details.

    Thank you for understanding!

    Best regards
    Melissa


    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments