Workday and alternative

Vineet S 1,390 Reputation points
2024-07-16T04:34:21.7233333+00:00

Hi, I have a table which needs to duplicate with weekday and alternative create table table3 ( col1 varchar(20) , col2 varchar(20)) expected results Insert into table1 values('catch', 'catch1') Catch--------catch1-------workday catch---------catch1--------alternative

Azure SQL Database
SQL Server Integration Services
SQL Server Migration Assistant
SQL Server Migration Assistant
A Microsoft tool designed to automate database migration to SQL Server from Access, DB2, MySQL, Oracle, and SAP ASE.
SQL Server | Other
0 comments No comments
{count} votes

Answer accepted by question author
  1. LiHongMSFT-4306 31,616 Reputation points
    2024-07-16T05:57:41.2633333+00:00

    Hi @Vineet S

    Try something like this: Insert the desired result into a new table

    ;WITH CTE AS
    (
    SELECT col1, col2,'WorkDay' AS col3
    FROM table3
    UNION 
    SELECT col1, col2,'alternative'
    FROM table3
    )
    SELECT * 
    INTO NewTable
    FROM CTE
    

    Best regards,

    Cosmog


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.