Thema Datum  Von Nutzer Rating
Antwort
Rot INSERT/ UPDATE from Excel to SQL via VBA (Makro with Button)
15.04.2021 11:18:37 Eintracht00
NotSolved

Ansicht des Beitrags:
Von:
Eintracht00
Datum:
15.04.2021 11:18:37
Views:
730
Rating: Antwort:
  Ja
Thema:
INSERT/ UPDATE from Excel to SQL via VBA (Makro with Button)

Hab das ganze schonmal in einem Anderen Forum gefragt, aber leider keine Antwort drauf bekommen... {Ja ich weiß, ist auf Englisch}

I have a table in SQL Server.

I have a function for Refresh (SELECT) and DeleteRow (DELETE).

Now I want to do a Change Button, where I can INSERT/ UPDATE whatever is need.

My table's columns are:

  • {Number (Integer) [this isn't ID autoincrement, its based on the Objects I got in a map]
  • ARBPL (nvarchar(max))
  • Area (nvarchar(Max))
  • X_Koordinate (Integer)
  • Y_Koordinate (Integer)}

I found in the internet something like

INSERT INTO {WHERE NOT ID IN (SELECT ID FROM dbo.Table)}

I don't got it working. My Idea was doing the INSERT like above and than do an FULL Update or an Update where the rows/ cells changed.

For example I have data like this:

1, ARB4875, LAK, 50, 70
72, ARB8879, MON, NULL, NULL

I need to get another Case where some Values could be NULL.

I just build a method before where the INSERT/ UPDATE is changed if anything changed on Worksheet but that isn't perfomant and it's not working if I copy-paste a lot of values so I want to do it with a button.

PS: is there a way too, how can I change the values to NULL if needed, maybe if one of the objects get deleted. and there isn't any coordinates finally


Ihre Antwort
  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen
Thema: Name: Email:



  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen

Thema Datum  Von Nutzer Rating
Antwort
Rot INSERT/ UPDATE from Excel to SQL via VBA (Makro with Button)
15.04.2021 11:18:37 Eintracht00
NotSolved