Simple SQL statement question ?

  • Hi All.

     

    I have an insert statement that just wont be OK even though I thought it should be simple one....

    I have one table with a lot o countrycodes like

    ID, CountryCode

    1    SE

    2    GB

    3    FR

    Then I have another table holding different Transactions..each transaction have a description for only one language. This table has got a transactionid,a languageid and a descriptive text. What I would like to do is insert additional rows for each transaction so that each transactionID have got the same description but for all languages existing in my countrycode table(see above).

    Initially my transaction table looks like this:

    TransactionID     CountryCode     DescriptionText

    1                      SE                   trans 1

    2                      FR                   trans2

     

    After the insert operation based on the content of the countrycode table example  above I would like the table to look like:

    TransactionID     CountryCode     DescriptionText

    1                      SE                   trans 1

    1                      GB                   trans 1

    1                      FR                   trans1

    2                      SE                   trans 2

    2                      GB                   trans 2

    2                      FR                   trans2

     

    How can I do this with a single statement ?? Help appreciated

    Cheers

  • Please don't cross-post...your question was answered here:

    http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=8&messageid=246133

  • Please check up whether there is any primary key, foreign key set in the second table?

    Please let me have the error message when you try to insert.

    V.kadal Amutham

    vkadal@gmail.com

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

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