copy data from one table to another and run regex on the data befor inserting RRS feed

  • Question

  • User-323149085 posted

    Hello  ,

    i need to copy data from another table twice each time to diff column , one column as is & second column after running regex to trim space

    should  be like this  (I'm not sure how to and i have a lot of real world data there ),

     One more catch is that none of this data is key in any way is should be just 2 strings

    USE MY_Table_Name;
    CREATE TABLE dbo.Venue( [Slug] nvarchar(512) NOT NULL ,
      [Name] nvarchar(512) NOT NULL);
    INSERT INTO dbo.Venue
        SELECT Venue, //Next is what i have no Idea how to 
        FROM LectureGigs.Venue;

    i need to insert into Slug the same data(Venue)  but i need to run this regex first

    Regex.Replace(Regex.Replace(Venue, "[^\\w]", ""), "[-]{2,}", "");

    any idea on how to do it is welcome

      thanks ,

    Monday, March 6, 2017 4:53 PM


All replies