July 11, 2005 at 1:43 am
Hi
I am building 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
July 11, 2005 at 4:10 am
July 11, 2005 at 4:31 am
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?
July 11, 2005 at 11:00 am
Do it in QA with "update table set stateID = ...where rows = ...."
**ASCII stupid question, get a stupid ANSI !!!**
July 11, 2005 at 11:14 pm
yea,i did consider it but the problem is that the update would only replace the IDs for the original data while i need to copy it,changing only the TimeID and StateID..???
July 11, 2005 at 11:21 pm
Hi
try this .
Select *,Identity(1,1)NewID Into #Temp from YourTable .
Update YourTable Set TimeID=NewTimeId, StateID=NewStateID where NewID =YourCondition
Delete from YourTable
Insert Into YourTable
Select * From #Temp.
Hope this works.
If it doesn't can you post your table structure?
July 11, 2005 at 11:34 pm
Thanx guyz!the problem has been solved...
http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=169&messageid=199194&post=true
take care...thanx once again...
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply