Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2003
    Posts
    47

    Unanswered: Create a table using a Query

    Hello,

    With Oracle, we can create a table as following :

    CREATE TABLE tab_name
    AS SELECT
    col1, col2...
    from tab1, tab2
    where ....


    With MSSQL, can we do the same thing ?

  2. #2
    Join Date
    Aug 2002
    Location
    Scotland
    Posts
    1,578
    The SELECT INTO statement creates a new table and populates it with the result set of the SELECT. The structure of the new table is defined by the attributes of the expressions in the select list.

    I suggest you to refer to books online for more information.
    --Satya SKJ
    Microsoft SQL Server MVP
    [IMG]http://sqlserver-qa.net/google_bart.gif[/IMG]

  3. #3
    Join Date
    Oct 2003
    Posts
    47
    Thanks a lot

  4. #4
    Join Date
    Aug 2002
    Location
    Scotland
    Posts
    1,578
    No mention, keep in touch with BOL
    --Satya SKJ
    Microsoft SQL Server MVP
    [IMG]http://sqlserver-qa.net/google_bart.gif[/IMG]

Posting Permissions

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