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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 insert into

Author  Topic 

mana
Posting Yak Master

102 Posts

Posted - 2015-01-26 : 04:49:32
Hello

i have the following code and when i run it i have the below erro
incoorrect syntax near ')'. can oyu help me please? message 102.
Msg 102, Level 15, State 1, Line 11



insert into Reporting.dbo.Nacharbeitmanagement_From_AQISdatabase(Auftrag, Datum_Offline, Seriennummer, Benennung, Land, Letzter_Platz, AVG_RepZeit_Offen, AnzFehler_Offen,
AVG_RepZeit_Total, AnzFehler_Total)
(SELECT Auftrag,Datum_Offline,Seriennummer,Benennung,Land,Letzter_Platz,round(AVG_RepZeit_Offen/60,0) as avg1,
AnzFehler_Offen,round(AVG_RepZeit_Total/60,0) as avg2,AnzFehler_Total
FROM AQIs.dbo.v_Nacharbeits_Forcast

WHERE NOT EXISTS (SELECT *
FROM Reporting.dbo.Nacharbeitmanagement_From_AQISdatabase
WHERE
Reporting.dbo.Nacharbeitmanagement_From_AQISdatabase.Auftrag=
AQIs.dbo.v_Nacharbeits_Forcast.Auftrag)

sz1
Aged Yak Warrior

555 Posts

Posted - 2015-01-26 : 05:31:05
insert into Reporting.dbo.Nacharbeitmanagement_From_AQISdatabase(Auftrag,
Datum_Offline, Seriennummer, Benennung, Land, Letzter_Platz, AVG_RepZeit_Offen, AnzFehler_Offen,
AVG_RepZeit_Total, AnzFehler_Total)
SELECT Auftrag,Datum_Offline,Seriennummer,Benennung,Land,Letzter_Platz,round(AVG_RepZeit_Offen/60,0) as avg1,
AnzFehler_Offen,round(AVG_RepZeit_Total/60,0) as avg2,AnzFehler_Total
FROM AQIs.dbo.v_Nacharbeits_Forcast

WHERE NOT EXISTS (SELECT *
FROM Reporting.dbo.Nacharbeitmanagement_From_AQISdatabase
WHERE
Reporting.dbo.Nacharbeitmanagement_From_AQISdatabase.Auftrag=
AQIs.dbo.v_Nacharbeits_Forcast.Auftrag)

We are the creators of our own reality!
Go to Top of Page
   

- Advertisement -