Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
mana
Posting Yak Master
102 Posts |
Posted - 2014-10-16 : 05:41:52
|
Hello,i wrote the following insert but it has problem and i can't understand where the problem is. i want to add data to Reporting.dbo.Nacharbeitmanagement_from_AQIS from a view and in this table datum_offline and Auftrag are primary key. I dont't want that the repeated rows will be added.can you guid eme please?thnak you for your helpinsert into Reporting.dbo.Nacharbeitmanagement_from_AQIS(Auftrag, Datum_Offline, Seriennummer, Benennung, Land, Letzter_Platz, AVG_RepZeit_Offen, AnzFehler_Offen, AVG_RepZeit_Total, AnzFehler_Total)select a.* from(select Auftrag, Datum_Offline, Seriennummer, Benennung, Land, Letzter_Platz, AVG_RepZeit_Offen, AnzFehler_Offen, AVG_RepZeit_Total, AnzFehler_TotalFROM dbo.v_Nacharbeits_Forcast) as aleft join Reporting.dbo.Nacharbeitmanagement_from_AQIS bwhere b.Datum_Offline is null; |
|
mmkrishna1919
Yak Posting Veteran
95 Posts |
Posted - 2014-10-16 : 07:14:33
|
The join condition is missed.where a.Auftrag = b.Auftrag and a.Datum_Offline = b.Datum_Offline and b.Datum_Offline is null;M.MURALI kRISHNA |
|
|
|
|
|
|
|