Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004
    Posts
    205

    Unanswered: Nested table concept in SQL Server

    Hi all,

    What is the equivalent for Oracle's nested table concept in SQL Server ?
    Is there anything like TABLE( ) function to select from nested table as in Oracle ?

    Eg in Oracle :

    SELECT t.* FROM TABLE(nested_table_datatype) t;

    ( like the above query used in Oracle PL/SQL and 'nested_table_datatype' is a table datatype created in Oracle using 'create type ...' syntax )

    Please give the equivalent for above...

    Thanks,
    Sam

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    thank $deity, there is no equivalent in sql server, for nested tables are evil
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    MS-SQL is a relational database. Oracle is a database with an SQL-like command language. There is a significant difference, neither one is inherantly better or worse than the other. They aren't comparable.

    No relational database can have anything like Oracle's nested tables. Nested tables implicitly violate the first normal form.

    In a relational database like MS-SQL, you can do exactly the same thing as a nested table by using a foreign key relationship. Create a second table using the same schema you would use for an Oracle nested table, adding a "link" column. Include the value from the "link" column in the parent row, so that you can join the main table to the logically "nested" table.

    -PatP

Posting Permissions

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