Copying rows without losing consistency??

  • Hi

    I am entering the sample data for a type of relationship table(Fact Table)  but the problem is that basically i only have to change the key value for the "State"(US) and the rest of the data can remain the same but whenever i try to do just that,the copy goes fine..but when i try to update the "State ID" attribute, it wont let me do that...it gives the error," Key Column information is insufficient or incorrect. Too many rows were affected by update"...

    this is despite the fact that the said attribute has NOT been declared a key...

    can anyone tell me why i am encountering this frustrating error and how can i get around it? i shall be REALLY thankful as it would save a lot of time inputting data...:-S

  • Will it be possible for you to elaborate more on the structure of your table, like what are the fields and what are the keys? -- So that i can get better idea of your scenario...

  • i have a fact table(basically,a sorta relationship table if u havent worked in multi dimensions yet) which tries to link the time dimension(table) having "Time ID" Key and a State Dimension having a "State ID" with a "State Description" attribute having the name of the state...now, there are other attributes in the fact table(the relationship) which is allowable in multi dimensions, now i have to put in sample data for 3 years and it doesnt matter if the data for two years is the same..ok?

    so i basically wanted to copy the data i had entered for year 2003 and simply change the TIme ID and StateID for that data...tell me if u need any further explanation

  • http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=9&messageid=199196

    Please do not cross post.

    Based on your response under the other post,

    "yea,i am trying to do that thru the enterprise manager...any way around it? i dont want to waste ages entering sample data... there wud be 144 tuples AT LEAST for just one year...any suggestions?"

    You can do this in a simple query.

    INSERT INTO fact_table ( TimeID, StateID, other measures )
    SELECT <new timeID I choose>, <new StateID I choose>, other measures
    FROM fact_table

    include one of the following where clauses.

    WHERE TimeID = <the timeID I want to duplicate>
    or
    WHERE StateID = <the StateID I want to duplicate>
    

     

    --------------------
    Colt 45 - the original point and click interface

  • Thank you SOOOO much....u are the man!!! saved me hours of useless work...now,i DO believe that such forums offer help! thanx once again!

Viewing 5 posts - 1 through 4 (of 4 total)

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