Results 1 to 4 of 4

Thread: Table Creation

  1. #1
    Join Date
    Sep 2003
    Posts
    212

    Unanswered: Table Creation

    Is there a way to create a table the results of a query?

    Like in Oracle u can do:

    create table NEWTABLE as (Select col1, col2 from OLDTABLE where ...)

    the NEWTABLE would have the same col definition as the OLDTABLE but only with 2 columns.

    Is this possible in SQL Server 2000?

  2. #2
    Join Date
    Sep 2003
    Location
    Dallas, Texas
    Posts
    311

    Re: Table Creation

    select * into NEWTABLE from OldTable.

  3. #3
    Join Date
    Sep 2003
    Posts
    212

    Re: Table Creation

    Originally posted by joejcheng
    select * into NEWTABLE from OldTable.
    the 'select into' statement doesnt log in the current activitiy monitor in EM. Thats whys i have doubts about it.

  4. #4
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    I'm curious about your doubts...

    Since it's a repeatable method based on SQL (givem at a point in time)

    If you want it logged...

    CREATE TABEL myAtbe99 (col1, ect)

    INSERT INTO myTable99 (Col1, ect)
    SELECT <sql statement>

    What's to doubt?

    You gotta make a decision...does it need to be logged or not?
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

Posting Permissions

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