Autor Beitrag
Flash106
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 234


D7 Ent
BeitragVerfasst: Mi 26.01.05 17:27 
Hallo..

wie kann ich einen Datensatz anlegen desen ID vom SQL server automatisch erhöht wird? Also immer wenn ich z.B. im programm auf 'neuer Benutzer' klicke das dann der Datensatz mit der ID 1 angelegt wird danach 2 usw. ???

Bianca
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Mi 26.01.05 18:27 
Welche Datenbank setzt du ein?
Falls es eine richtige SQL-Datenbank ist, schaue dort mal unter Sequence.
Flash106 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 234


D7 Ent
BeitragVerfasst: Mi 26.01.05 18:55 
Ich nutze nen MSSQL server. mir geht es eher um den Befehl zum reinschreiben.. einfach INSERT INTO???!?!.. hatte da damals immer fehler bekommen...
Flash106 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 234


D7 Ent
BeitragVerfasst: Mi 26.01.05 19:01 
aahhh es GEHT!! sorry für den sinnlosen post.. hab damals IMMER fehler bekommen... :oops:
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Mi 26.01.05 19:07 
Den MS-SQL-Server kenne ich nicht so genau. Ich meine aber, dass es dort AutoInc-Felder gibt. Um die musst du dich dann beim Insert nicht kümmern.
Andererseits darfst du dich auch nicht darum kümmern.
D.h.:
du musst das Insert mit "values" machen. Also alle Felder angeben, die einen Wert bekommen sollen und die Werte angeben.
Beispiel:
ausblenden Quelltext
1:
2:
Insert into Tabelle (feld2, feld3, feld4)
values (wert1, wert2, wert4)


EDIT: TssTss. Irgendwie bin ich heute zu langsam. Alle lösen ihre Probleme selbst. :cry: