how can i get a table to go inside another table

  • i have a table (1) that i imported in DTS, just one column varchar 255 (name) about 400k records

    i have another table (2) that has 4 columns, the one i need is set to varchar 100, but has three other columns, (1) is RID indexed and key, (2) is LID and (3) is domainname.

    i need the first table to go into the second table along with a fixed LID (int,4)

    (I suppose i could create a new table 1 with two columns to include the LID that goes with name column to make things easier)

    any of this make sense? if yes, then how to do?

  • You create a second table, you give it a composite primary key that includes the column from the parent table, then you define a foreign key relationship.

    Tables don't contain tables, columns should contain atomic values (meaning can't be broken up further)

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • danmc58 (9/14/2011)


    i have a table (1) that i imported in DTS, just one column varchar 255 (name) about 400k records

    i have another table (2) that has 4 columns, the one i need is set to varchar 100, but has three other columns, (1) is RID indexed and key, (2) is LID and (3) is domainname.

    i need the first table to go into the second table along with a fixed LID (int,4)

    (I suppose i could create a new table 1 with two columns to include the LID that goes with name column to make things easier)

    any of this make sense? if yes, then how to do?

    It all depends of your definition of "go into the second table"... for the plain English language mean of the phrase, No; it does not makes sense.

    _____________________________________
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at Amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

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

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