need help

Please support our ASP.NET advertiser: 50% Off 6 Months Web Hosting from 1&1. The World's #1 Host!
Reply

Join Date: Mar 2006
Posts: 84
Reputation: web_developer is an unknown quantity at this point 
Solved Threads: 1
web_developer web_developer is offline Offline
Junior Poster in Training

need help

 
0
  #1
Apr 4th, 2006
hey all

i have a database containing many tables, 2 of the tables are same in attributes numbers and names but differs in tables names.

one is titled livecases and other is titled archivecases.
the two tables have a forgien key "typeid" from a table "ctype" to declare type of the case.

i can insert directly into archivecases but when i am using this command:
insert into archivecases select * from livecases where "condition"
i cant do it. "this sql comand makes u copy data from one table to another"
i got this error:

INSERT statement conflicted with COLUMN FOREIGN KEY constraint 'FK_case_archive_ctype1'. The conflict occurred in database 'zzz', table 'ctype', column 'typeid'. The statement has been terminated.

what the reason for this error? wht is the answer?

sam

thanks in advance
Reply With Quote Quick reply to this message  
Join Date: Apr 2006
Posts: 10
Reputation: Techscrip is an unknown quantity at this point 
Solved Threads: 0
Techscrip Techscrip is offline Offline
Newbie Poster

Re: need help

 
0
  #2
Apr 4th, 2006
Try providing the field names in your query...

Insert Into archivecases(CompanyName,City)
Select CompanyName, City From livecases
Where Country = 'Germany'

or

check the value entered in livecases table matches with the options available in table 'ctype'
Reply With Quote Quick reply to this message  
Join Date: Mar 2006
Posts: 84
Reputation: web_developer is an unknown quantity at this point 
Solved Threads: 1
web_developer web_developer is offline Offline
Junior Poster in Training

Re: need help

 
0
  #3
Apr 5th, 2006
thanks man
ur replay help me to find the answer
the problem was i must put the attributes in the 2 tables in same order.

sam
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the ASP.NET Forum


Views: 1169 | Replies: 2
Thread Tools Search this Thread



Tag cloud for ASP.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2010 DaniWeb® LLC