T-SQL

  • HI,

    Can I make a temprary table by using union operator.

    This is my query.

    (SELECT SUBSCRIBER_PHONE,primary_magazine_code FROM RBI..TBL8530

    WHERE SUBSCRIBER_PHONE IN(SELECT COL001 FROM RESULT))

    union

    (SELECT SUBSCRIBER_PHONE,primary_magazine_code FROM RBI..verified8530

    WHERE SUBSCRIBER_PHONE IN(SELECT COL001 FROM RESULT))

    I want to put the records in a temporary table.

    Another thing is that is there intersect and minus operator like union operator in sql server 2000.

    Regards

  • If you want it to go into a temp table, this works fine (I used Adventureworks to test it):

    SELECT ContactTypeID, [Name] INTO #mytem FROM Person.ContactType

    union

    SELECT StateProvinceID AS CultureID, [Name] FROM Person.StateProvince

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply